aparna0522 commented on code in PR #4445:
URL: https://github.com/apache/cassandra/pull/4445#discussion_r2492137615
##########
src/java/org/apache/cassandra/replication/CoordinatorLog.java:
##########
@@ -220,6 +227,9 @@ private void updateWitnessedReplicatedOffsets(Offsets
offsets, int onNodeId)
}
}
});
+
+ // Record metric for newly witnessed offsets only
+
MutationTrackingMetrics.instance.broadcastOffsetsDiscovered.inc(newlyWitnessedCount[0]);
Review Comment:
I think the bottom line is one atomic operation vs multiple. If addAll()
typically invokes the consumer just a few times, then, the difference is
negligible, in which case I can see the argument for cleaner code without the
array.
Additionally, I tried to check how other metrics are being collected and I
see an accumulate-then-increment pattern, which is similar to the current
implementation.
--
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]