Search in sources :

Example 11 with MetricName

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));
}
Also used : MetricName(com.yammer.metrics.core.MetricName)

Example 12 with MetricName

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);
    }
}
Also used : MetricName(com.yammer.metrics.core.MetricName) DateFormat(java.text.DateFormat) SortedMap(java.util.SortedMap) Metric(com.yammer.metrics.core.Metric) Date(java.util.Date)

Aggregations

MetricName (com.yammer.metrics.core.MetricName)12 ClusterId (com.nokia.dempsy.config.ClusterId)1 Destination (com.nokia.dempsy.messagetransport.Destination)1 Counter (com.yammer.metrics.core.Counter)1 Meter (com.yammer.metrics.core.Meter)1 Metric (com.yammer.metrics.core.Metric)1 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)1 DateFormat (java.text.DateFormat)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 SortedMap (java.util.SortedMap)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 Configuration (org.apache.commons.configuration.Configuration)1 MapConfiguration (org.apache.commons.configuration.MapConfiguration)1 Test (org.junit.Test)1 Test (org.testng.annotations.Test)1