Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FirstMessageAge and FirstMessageTimestamp JMX metrics for queues. #839

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

NikitaShupletsov
Copy link

This change is meant to match the piece of functionality from Artemis: apache/activemq-artemis@00837c1

Add two new JMX attributes for queues: FirstMessageAge and FirstMessageTimestamp.
First one shows the diff between current time and the message timestamp of the first message in the queue.
Second one shows the message timestamp of the first message in the queue.

@mattrpav mattrpav self-requested a review May 10, 2022 18:36
@mattrpav
Copy link
Contributor

mattrpav commented May 10, 2022

ref: https://issues.apache.org/jira/browse/AMQ-8463

I'd like to review the naming here, given the plans to add additional metrics. We should have it all align.

Metrics:

nextMessageEnqueuedTimestamp (from the message’s brokerInTime)
nextMessageTimestamp
nextMessageID

(‘last’ aka the most recent message to be ack’d — processed in-flight)
lastEnqueuedMessageTimestamp (from brokerInTime on the message)
lastDequeuedTimestamp (clock timestamp of when the message was dequeued)
lastDequeuedMessageTimestamp (from brokerInTime on the message)
lastDequeuedMessageID

(‘First’ aka first all time in the life of the destination since boot — processed in-flight)
firstEnqueuedMessageTimestamp (from brokerInTime)
firstEnqueuedMessageID
firstDequeuedTimestamp (wall clock time when the message was dequeued)
firstDequeuedMessageID
firstDequeuedMessageTimestamp (from brokerInTime)

@NikitaShupletsov
Copy link
Author

Initially the idea was to call it oldestMessageAge or ageOfOldestMessage, but then I came across the artemis metric and decided to use the same name for the sake of consistency.
So, what do you think? does oldest instead of first sound better?

@jbonofre jbonofre self-requested a review October 20, 2023 06:04
@jbonofre
Copy link
Member

The change looks good to me. I think using firstMessageTimestamp is good. However, I would also add lastMessageTimestamp.

I will resume my work on this one (spinning another one).

@mattrpav
Copy link
Contributor

I think this approach is incorrect, and we should revisit the approach in 6.1.0

@jbonofre jbonofre added this to the 6.1.0 milestone Oct 21, 2023
@jbonofre
Copy link
Member

We will see later but I will probably close this PR with a new one for 6.1.0 with a different impl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants