rahulrane50 commented on code in PR #2344:
URL: https://github.com/apache/helix/pull/2344#discussion_r1089339988
##########
helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ResourceMonitor.java:
##########
@@ -139,6 +142,10 @@ public ResourceMonitor(String clusterName, String
resourceName, ObjectName objec
_partitionTopStateNonGracefulHandoffDurationGauge =
new HistogramDynamicMetric("PartitionTopStateNonGracefulHandoffGauge",
new Histogram(
new SlidingTimeWindowArrayReservoir(getResetIntervalInMs(),
TimeUnit.MILLISECONDS)));
+ _missingTopStateDurationGuage =
+ new HistogramDynamicMetric("MissingTopStateDurationGauge", new
Histogram(
+ new SlidingTimeWindowArrayReservoir(getResetIntervalInMs(),
TimeUnit.MILLISECONDS)));
Review Comment:
That's an excellent suggestion. After digging deeper, so the way Histrogram
metrics works is based on reservoir sampling meaning even if stream of samples
are provided to this guage but it will pick only k random samples (or based on
sliding window provided here) and discard other samples provided. But still i
just add sleep for very less duration to save some CPU cycles. So to summarize,
as long as metric reporting is concerned, no matter how many samples are
provided to this guage only handlful of samples will be emitted by helix
controller.
Code pointer for reference :
https://www.tabnine.com/code/java/classes/com.codahale.metrics.SlidingTimeWindowArrayReservoir
--
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]