use of com.yammer.metrics.core.Counter in project bagheera by mozilla-metrics.
the class HttpMetric method updateResponseMetrics.
public void updateResponseMetrics(int status) {
if (responseCodeCounts.containsKey(status)) {
responseCodeCounts.get(status).inc();
} else {
Counter statusCounter = Metrics.newCounter(new MetricName(DEFAULT_GROUP, DEFAULT_TYPE, this.id + ".response." + status));
statusCounter.inc();
responseCodeCounts.put(status, statusCounter);
}
}
use of com.yammer.metrics.core.Counter in project pinot by linkedin.
the class AggregatedCounter method refresh.
/**
* Update counter from underlying counters.
*/
public void refresh() {
long count = 0;
for (Metric m : _counters) {
if (m instanceof Counter) {
count += ((Counter) m).count();
} else if (m instanceof AggregatedCounter) {
count += ((AggregatedCounter) m).count();
}
}
_count = count;
}
Aggregations