aweisberg commented on code in PR #3068:
URL: https://github.com/apache/cassandra/pull/3068#discussion_r1476357474


##########
src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:
##########
@@ -41,15 +57,20 @@
  */
 public class CassandraMetricsRegistry extends MetricRegistry
 {
-    public static final CassandraMetricsRegistry Metrics = new 
CassandraMetricsRegistry();
+    private static final Logger logger = 
LoggerFactory.getLogger(CassandraMetricsRegistry.class);
+
+    public static final CassandraMetricsRegistry Metrics = new 
CassandraMetricsRegistry(Ints.checkedCast(TimeUnit.MICROSECONDS.toNanos(1)));
     private final Map<String, ThreadPoolMetrics> threadPoolMetrics = new 
ConcurrentHashMap<>();
 
     private final MBeanWrapper mBeanServer = MBeanWrapper.instance;
     public final static TimeUnit DEFAULT_TIMER_UNIT = TimeUnit.MICROSECONDS;
 
-    private CassandraMetricsRegistry()
+    final ScheduledFuture<?> periodicMeterTicker;
+
+    CassandraMetricsRegistry(int tickMetersPeriodMicros)

Review Comment:
   This is to make it possible for the unit test to create a metrics registry 
that runs these ticks frequently. To have it be testable there has to be some 
extension point, either a method that can be overridden or a parameter to the 
class to allow for manipulating the task scheduling frequency.



-- 
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]

Reply via email to