jbonofre commented on code in PR #1985:
URL: https://github.com/apache/activemq/pull/1985#discussion_r3177653644
##########
activemq-broker/src/main/java/org/apache/activemq/store/PersistenceAdapterStatistics.java:
##########
@@ -19,6 +19,8 @@
import org.apache.activemq.management.StatsImpl;
import org.apache.activemq.management.TimeStatisticImpl;
+import java.util.Set;
Review Comment:
nit: usually this import should be beofre the `org.apache.activemq` (same on
the other classes).
##########
activemq-broker/src/main/java/org/apache/activemq/broker/region/SubscriptionStatistics.java:
##########
@@ -45,12 +45,7 @@ public SubscriptionStatistics(boolean enabled) {
dequeues = new CountStatisticImpl("dequeues", "The number of messages
that have been acknowledged from the subscription");
inflightMessageSize = new SizeStatisticImpl("inflightMessageSize",
"The size in bytes of messages dispatched but awaiting acknowledgement");
- addStatistic("consumedCount", consumedCount);
- addStatistic("enqueues", enqueues);
- addStatistic("dispatched", dispatched);
- addStatistic("dequeues", dequeues);
- addStatistic("inflightMessageSize", inflightMessageSize);
-
+ addStatistics(Set.of(consumedCount, enqueues, dispatched,
inflightMessageSize));
Review Comment:
I think it should iniclude `dequeues`here:
```suggestion
addStatistics(Set.of(consumedCount, enqueues, dispatched, dequeues,
inflightMessageSize));
```
##########
activemq-broker/src/main/java/org/apache/activemq/network/NetworkBridgeStatistics.java:
##########
@@ -34,9 +35,7 @@ public NetworkBridgeStatistics() {
dequeues = new CountStatisticImpl("dequeues", "The current number of
dequeues this bridge has, which is the number of messages received by the
remote broker.");
receivedCount = new CountStatisticImpl("receivedCount", "The number of
messages that have been received by the NetworkBridge from the remote broker.
Only applies for Duplex bridges.");
- addStatistic("enqueues", enqueues);
- addStatistic("dequeues", dequeues);
- addStatistic("receivedCount", receivedCount);
+ addStatistics(Set.of(enqueues, dequeues, receivedCount));
Review Comment:
```suggestion
addStatistics(Set.of(enqueues, dequeues, receivedCount));
```
##########
activemq-broker/src/main/java/org/apache/activemq/store/PersistenceAdapterStatistics.java:
##########
@@ -31,14 +33,11 @@ public PersistenceAdapterStatistics() {
slowCleanupTime = new TimeStatisticImpl("slowCleanupTime", "Slow time
to cleanup data in the PersistentAdapter.");
slowWriteTime = new TimeStatisticImpl("slowWriteTime", "Slow time to
write data to the PersistentAdapter.");
slowReadTime = new TimeStatisticImpl("slowReadTime", "Slow time to
read data from the PersistentAdapter.");
- addStatistic("slowCleanupTime", slowCleanupTime);
- addStatistic("slowWriteTime", slowWriteTime);
- addStatistic("slowReadTime", slowReadTime);
-
+
writeTime = new TimeStatisticImpl("writeTime", "Time to write data to
the PersistentAdapter.");
readTime = new TimeStatisticImpl("readTime", "Time to read data from
the PersistentAdapter.");
- addStatistic("writeTime", writeTime);
- addStatistic("readTime", readTime);
+
+ addStatistics(Set.of(slowCleanupTime, slowWriteTime, slowReadTime,
writeTime, readTime));
Review Comment:
```suggestion
addStatistics(Set.of(slowCleanupTime, slowWriteTime, slowReadTime,
writeTime, readTime));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact