Mmuzaf commented on code in PR #3068:
URL: https://github.com/apache/cassandra/pull/3068#discussion_r1478337120
##########
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:
I would change
```
for (Meter meter : getMeters().values())
{
...
}
```
to the following
```
for (Metric metric : getMetrics().values())
{
if (!Meter.class.isInstance(metric))
continue;
...
}
```
--
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]