Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion deps/rabbit/src/rabbit_osiris_metrics.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
memory,
readers,
consumers,
segments
segments,
first_timestamp
]).

-record(state, {timeout :: non_neg_integer()}).
Expand Down
10 changes: 9 additions & 1 deletion deps/rabbit/src/rabbit_stream_queue.erl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
-define(INFO_KEYS, [name, durable, auto_delete, arguments, leader, members, online, state,
messages, messages_ready, messages_unacknowledged, committed_offset,
policy, operator_policy, effective_policy_definition, type, memory,
consumers, segments, committed_chunk_id]).
consumers, segments, committed_chunk_id, first_timestamp]).

-define(UNMATCHED_THRESHOLD, 200).

Expand Down Expand Up @@ -825,6 +825,14 @@ i(segments = F, Q) ->
_ ->
''
end;
i(first_timestamp = F, Q) ->
Key = {osiris_writer, amqqueue:get_name(Q)},
case osiris_counters:counters(Key, [F]) of
#{F := V} ->
V;
_ ->
''
end;
i(policy, Q) ->
case rabbit_policy:name(Q) of
none -> '';
Expand Down
6 changes: 6 additions & 0 deletions deps/rabbitmq_management/priv/www/js/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,16 @@ function fmt_date0(d) {
}

function fmt_timestamp(ts) {
if (ts == undefined) {
return UNKNOWN_REPR;
}
return fmt_date(new Date(ts));
}

function fmt_timestamp_mini(ts) {
if (ts == undefined) {
return UNKNOWN_REPR;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes show the dimmed "?" when the page is waiting for data to arrive. Otherwise these fmts would show "NaN-NaN-NaN"

}
return fmt_date_mini(new Date(ts));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<th>Segments</th>
<td><%= fmt_string(queue.segments) %></td>
</tr>
<tr>
<th>Oldest message</th>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Oldest message" ? "First timestamp" ? I'm not attached to the phrasing here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Oldest" is unambiguous while "first" can be interpreted as the head or the tail, so I'd use "oldest" personally.

<td><%= fmt_timestamp_mini(queue.first_timestamp) %></td>
</tr>
</table>

<table class="facts">
Expand All @@ -53,4 +57,4 @@
</th>
<td class="r"><%= fmt_bytes(queue.memory) %></td>
</tr>
</table>
</table>
Loading