Mmuzaf commented on code in PR #3068:
URL: https://github.com/apache/cassandra/pull/3068#discussion_r1476132042
##########
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:
I think we don't need to pass the argument to the constructor and can use a
constant variable instead. We can also add a javadoc to this constant so that
the default value can be indexed by search engines once the javadocs are
published,
e.g.
`/* Schedule a task to read all the meters once a day so it isn’t done in
the request path and we have a more incremental amount to process at a time.
Default value {@code 1} day. */ `
--
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]