WIP: AMQ-9552: Add metric lastMessageTimestamp to StatisticsBroker based o…
Add metric lastMessageTimestamp to StatisticsBroker based on modification time of metric enqueues:
// NOTICE: Client-side, you may get the broker "now" Timestamp by msg.getJMSTimestamp()
// This allows for calculating inactivity.
statsMessage.setLong("lastMessageTimestamp", stats.getEnqueues().getLastSampleTime());
Some examples per threshold of this metric from real life implementation:
I have started a capability to put additional statistics behind a config flag, so adding new metrics such as lastMessageTimestamp, lastMessageId, etc.. do not add computation overhead to all queues by default to all users.
The statistics broker update should wait to follow the work done for the core capability.
The field names should be consistent across all APIs and functions. There are other requests to add deeper observability fields -- firstEnqueue, lastEnqueue, firstDequeue, etc.. so 'lastMessageTimestamp' as a field name is not specific enough to meet all the requests.
ref: [AMQ-9426]
The initial work for the feature is here: https://github.com/apache/activemq/pull/1156
The advancedMessageFlow statistics are implemented and released in 5.19.x (and soon 6.2.0)
Please review the added metrics: https://github.com/apache/activemq/blob/main/activemq-client/src/main/java/org/apache/activemq/management/MessageFlowStatsImpl.java#L21
I believe this PR is addressed with the enqueuedMessageBrokerInTime or enqueuedMessageTimestamp value.
yup, thank you, closing