dcapwell commented on a change in pull request #1146:
URL: https://github.com/apache/cassandra/pull/1146#discussion_r689931517
##########
File path:
test/distributed/org/apache/cassandra/distributed/impl/InstanceMetrics.java
##########
@@ -45,16 +45,32 @@
this.metricsRegistry = metricsRegistry;
}
+ @Override
public List<String> getNames()
{
return new ArrayList<>(metricsRegistry.getNames());
}
+ @Override
public long getCounter(String name)
{
- return metricsRegistry.getCounters().get(name).getCount();
+ Counter counter = metricsRegistry.getCounters().get(name);
+ if (counter != null)
+ return counter.getCount();
+ Meter meter = metricsRegistry.getMeters().get(name);
+ if (meter != null)
+ return meter.getCount();
+ Histogram histogram = metricsRegistry.getHistograms().get(name);
+ if (histogram != null)
+ return histogram.getCount();
+ Timer timer = metricsRegistry.getTimers().get(name);
+ if (timer != null)
+ return timer.getCount();
+ //TODO no way to handle not found other than NPE?
Review comment:
this was taken out of
https://issues.apache.org/jira/browse/CASSANDRA-16850 and asked @ifesdjeen to
review it there
--
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]