[
https://issues.apache.org/jira/browse/AMQ-9552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17876186#comment-17876186
]
Grzegorz Kochański commented on AMQ-9552:
-----------------------------------------
Value 0 has a special meaning, let's keep it inside {{StatisticImpl}} add
dedicated method:
{code:java}
public synchronized long getLastSampleTimeOrStartTime(){
return lastSampleTime == 0 ? startTime : lastSampleTime;
} {code}
so all together may look like:
https://github.com/apache/activemq/compare/e45ee4aae5b49986750d5a2feb171f36cf432fca..e0bf09d3fae4b83ac25302db9536432a94dffb6f
> 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: 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: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact