[ 
https://issues.apache.org/jira/browse/AMQ-8463?focusedWorklogId=947664&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-947664
 ]

ASF GitHub Bot logged work on AMQ-8463:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Dec/24 21:27
            Start Date: 10/Dec/24 21:27
    Worklog Time Spent: 10m 
      Work Description: mattrpav commented on code in PR #1329:
URL: https://github.com/apache/activemq/pull/1329#discussion_r1878876829


##########
activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationStatistics.java:
##########
@@ -76,6 +87,17 @@ public DestinationStatistics() {
         networkEnqueues = new CountStatisticImpl("networkEnqueues", "The 
number of messages that have been sent to the destination via network 
connection");
         networkDequeues = new CountStatisticImpl("networkDequeues", "The 
number of messages that have been acknowledged from the destination via network 
connection");
 
+        enqueuedMessageBrokerInTime = new 
UnsampledStatisticImpl<>("enqueuedMessageBrokerInTime", "ms", "Broker in time 
(ms) of last enqueued message to the destination", Long.valueOf(0l));
+        enqueuedMessageClientID = new 
UnsampledStatisticImpl<>("enqueuedMessageClientID", "id", "ClientID of last 
enqueued message to the destination", null);
+        enqueuedMessageID = new UnsampledStatisticImpl<>("enqueuedMessageID", 
"id", "MessageID of last enqueued message to the destination", null);
+        enqueuedMessageTimestamp = new 
UnsampledStatisticImpl<>("enqueuedMessageTimestamp", "ms", "Message timestamp 
of last enqueued message to the destination", Long.valueOf(0l));
+
+        dequeuedMessageBrokerInTime = new 
UnsampledStatisticImpl<>("dequeuedMessageBrokerInTime", "ms", "Broker in time 
(ms) of last dequeued message to the destination", Long.valueOf(0l));

Review Comment:
   I experimented with this. I ran into a condition where supporting dynamic 
config update (good feature) would require a lock around all advanced network 
and advanced message stats operations. See: [WIP 
commit]([https://github.com/apache/activemq/pull/1329/commits/92ab4e7b05dc2395574cc53270438ee6e0f996d5])
   
   Possible paths to move forward:
   
   Option 1: Do not optimize for memory, allocate all metrics at startup time
   
   Option 2: Lazy init advanced stats fields. Support only allocating 
statistics when moving from enabled = false to enabled = true. Moving from 
enabled = true to enabled = false would leave advanced metrics fields present 
(or perhaps they could be reset on disable)
   
   Option 3: Add locking around all the advanced[Network|Message]Statistics 
operations (bleh)



##########
activemq-broker/src/main/java/org/apache/activemq/broker/region/DestinationStatistics.java:
##########
@@ -76,6 +87,17 @@ public DestinationStatistics() {
         networkEnqueues = new CountStatisticImpl("networkEnqueues", "The 
number of messages that have been sent to the destination via network 
connection");
         networkDequeues = new CountStatisticImpl("networkDequeues", "The 
number of messages that have been acknowledged from the destination via network 
connection");
 
+        enqueuedMessageBrokerInTime = new 
UnsampledStatisticImpl<>("enqueuedMessageBrokerInTime", "ms", "Broker in time 
(ms) of last enqueued message to the destination", Long.valueOf(0l));
+        enqueuedMessageClientID = new 
UnsampledStatisticImpl<>("enqueuedMessageClientID", "id", "ClientID of last 
enqueued message to the destination", null);
+        enqueuedMessageID = new UnsampledStatisticImpl<>("enqueuedMessageID", 
"id", "MessageID of last enqueued message to the destination", null);
+        enqueuedMessageTimestamp = new 
UnsampledStatisticImpl<>("enqueuedMessageTimestamp", "ms", "Message timestamp 
of last enqueued message to the destination", Long.valueOf(0l));
+
+        dequeuedMessageBrokerInTime = new 
UnsampledStatisticImpl<>("dequeuedMessageBrokerInTime", "ms", "Broker in time 
(ms) of last dequeued message to the destination", Long.valueOf(0l));

Review Comment:
   I experimented with this. I ran into a condition where supporting dynamic 
config update (good feature) would require a lock around all advanced network 
and advanced message stats operations. See: [WIP 
commit](https://github.com/apache/activemq/pull/1329/commits/92ab4e7b05dc2395574cc53270438ee6e0f996d5)
   
   Possible paths to move forward:
   
   Option 1: Do not optimize for memory, allocate all metrics at startup time
   
   Option 2: Lazy init advanced stats fields. Support only allocating 
statistics when moving from enabled = false to enabled = true. Moving from 
enabled = true to enabled = false would leave advanced metrics fields present 
(or perhaps they could be reset on disable)
   
   Option 3: Add locking around all the advanced[Network|Message]Statistics 
operations (bleh)





Issue Time Tracking
-------------------

    Worklog Id:     (was: 947664)
    Time Spent: 3h 20m  (was: 3h 10m)

> Add advancedMessageStatistics to destinations
> ---------------------------------------------
>
>                 Key: AMQ-8463
>                 URL: https://issues.apache.org/jira/browse/AMQ-8463
>             Project: ActiveMQ Classic
>          Issue Type: Improvement
>          Components: Broker
>            Reporter: Matt Pavlovich
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 6.2.0
>
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> Observability and tracking metrics on the destination can provide current 
> message age and indication of message flow activity.
> // Most recent enqueued message info
> enqueuedMessageID 
> enqueuedMessageTimestamp
> enqueuedMessageBrokerInTime
> // Most recent dequeued message info
> dequeuedMessageID
> dequeuedMessageTimestamp
> dequeuedMessageBrokerInTime
> // First enqueue since boot
> firstEnqueuedMessageID
> firstEnqueuedMessageTimestamp 
> firstEnqueuedMessageBrokerInTime
> // First dequeue since boot
> firstDequeuedMessageID
> firstDequeuedMessageTimestamp
> firstDequeuedMessageBrokerInTime



--
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


Reply via email to