You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/10/10 21:48:00 UTC
[jira] [Work logged] (AMQ-9552) StatisticsPlugin - add metric lastMessageTimestamp
[ https://issues.apache.org/jira/browse/AMQ-9552?focusedWorklogId=937491&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-937491 ]
ASF GitHub Bot logged work on AMQ-9552:
---------------------------------------
Author: ASF GitHub Bot
Created on: 10/Oct/24 21:47
Start Date: 10/Oct/24 21:47
Worklog Time Spent: 10m
Work Description: mattrpav commented on code in PR #1285:
URL: https://github.com/apache/activemq/pull/1285#discussion_r1796134881
##########
activemq-broker/src/main/java/org/apache/activemq/plugin/StatisticsBroker.java:
##########
@@ -160,6 +160,11 @@ else if (dest instanceof Topic) {
tempFirstMessage.clear();
}
}
+ if ( stats.getEnqueues().hasUpdated() ) {
+ // NOTICE: Client-side, you may get the broker "now" Timestamp by msg.getJMSTimestamp()
+ // This allows for calculating inactivity.
+ statsMessage.setLong("lastMessageTimestamp", stats.getEnqueues().getLastSampleTime());
Review Comment:
@ggkochanski yeah, the challenge is settling on the terminology for the metric values.
For example, does 'last' mean last-as-in-time, or last-as-in-last-message-in-the-queue (most recently added)
Issue Time Tracking
-------------------
Worklog Id: (was: 937491)
Time Spent: 1h 20m (was: 1h 10m)
> StatisticsPlugin - add metric lastMessageTimestamp
> --------------------------------------------------
>
> Key: AMQ-9552
> URL: https://issues.apache.org/jira/browse/AMQ-9552
> Project: ActiveMQ Classic
> Issue Type: Improvement
> Components: Broker
> Reporter: Grzegorz Kochański
> Assignee: Jean-Baptiste Onofré
> Priority: Minor
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> Metric {{lastMessageTimestamp}} can be captured from the modification time of metric {{enqueues:}}
>
> {code:java}
> statsMessage.setLong("lastMessageTimestamp", stats.getEnqueues().getLastSampleTime()); {code}
>
> Disclaimer: disadvantage of such approach is that after broker restart this value is holding start time of the broker (which may be relevant when the frequency of broker restarts is comparable to the frequency of enqueued messages)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact