You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Grzegorz Kochański (Jira)" <ji...@apache.org> on 2024/08/23 06:52:00 UTC
[jira] [Comment Edited] (AMQ-9552) StatisticsPlugin - add metric lastMessageTimestamp
[ https://issues.apache.org/jira/browse/AMQ-9552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17876181#comment-17876181 ]
Grzegorz Kochański edited comment on AMQ-9552 at 8/23/24 6:51 AM:
------------------------------------------------------------------
[~jbonofre] thank you for the suggestion, it's much more consistent.
I've changed the initial value for {{StatisticImpl#lastSampleTime}} to 0. And to keep current behavior I've used {{StatisticImpl#startTime:}}
{code:java}
stat.getLastSampleTime() == 0 ? stat.getStartTime() : stat.getLastSampleTime(){code}
see [https://github.com/apache/activemq/compare/82eac7110abf300ed676164486d75d7e05edb0b9..ea04464d504245dbb381a1f138c70b913fec25cb]
was (Author: JIRAUSER304545):
[~jbonofre] thank you for the suggestion, it's much more consistent.
I've changed the initial value for {{StatsImpl#lastSampleTime}} to 0. And to keep current behavior I've used {{StatsImpl#startTime:}}
{code:java}
stat.getLastSampleTime() == 0 ? stat.getStartTime() : stat.getLastSampleTime(){code}
see https://github.com/apache/activemq/compare/82eac7110abf300ed676164486d75d7e05edb0b9..ea04464d504245dbb381a1f138c70b913fec25cb
> 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: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact