Mmuzaf commented on code in PR #3068:
URL: https://github.com/apache/cassandra/pull/3068#discussion_r1478286132
##########
src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:
##########
@@ -250,6 +271,43 @@ private void removeAlias(MetricName name)
if (mBeanServer.isRegistered(name.getMBeanName()))
MBeanWrapper.instance.unregisterMBean(name.getMBeanName(),
MBeanWrapper.OnException.IGNORE);
}
+
+ /**
+ * Very infrequently used meters generate a linear amount of tick work
based on how long it has been
+ * since the meter was last marked or read. On scales of a year this can
be enough to cause the first request
+ * that needs to mark the meter to time out. Once a day read every meter
to force them to run Meter.tickIfNecessary
+ * so we only ever run at most one day worth of tick work per meter in the
request path.
+ *
+ * This can be removed if we ever upgrade and switch the default
MovingAverage from EWMA to SlidingWindowTimeAverages
+ */
+ private void tickMeters()
+ {
+ List<Throwable> failures = new ArrayList<>();
+ int droppedFailures = 0;
+ for (Meter meter : getMeters().values())
Review Comment:
This is actually +2 extra lines of code! Anyway, it's not important for the
workaround itself, the comment is just based on the assumption that if we can
have zero impact, why shouldn't we? So I agree with you that the node can live
without it and this is not a place where we should save resources :-)
--
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]