use of com.yammer.metrics.core.MetricName in project platformlayer by platformlayer.
the class CodahaleMetricRegistry method getHistogram.
@Override
public MetricHistogram getHistogram(MetricKey metricKey) {
MetricName metricName = toMetricName(metricKey);
boolean biased = true;
return new MetricHistogramAdapter(registry.newHistogram(metricName, biased));
}
use of com.yammer.metrics.core.MetricName in project netty by netty.
the class CustomReporter method run.
@Override
public void run() {
try {
final DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, locale);
format.setTimeZone(timeZone);
final String dateTime = format.format(new Date(clock.time()));
out.print(dateTime);
out.print(' ');
for (int i = 0; i < CONSOLE_WIDTH - dateTime.length() - 1; i++) {
out.print('=');
}
out.println();
for (final Entry<String, SortedMap<MetricName, Metric>> entry : getMetricsRegistry().groupedMetrics(predicate).entrySet()) {
out.print(entry.getKey());
out.println(':');
for (final Entry<MetricName, Metric> subEntry : entry.getValue().entrySet()) {
out.print(" ");
out.print(subEntry.getKey().getName());
out.println(':');
subEntry.getValue().processWith(this, subEntry.getKey(), out);
out.println();
}
out.println();
}
out.println();
out.flush();
} catch (final Exception e) {
e.printStackTrace(out);
}
}
Aggregations