com.espertech.esper.metrics.codahale_metrics.metrics
Class Metrics

java.lang.Object
  extended by com.espertech.esper.metrics.codahale_metrics.metrics.Metrics

public class Metrics
extends java.lang.Object

A set of factory methods for creating centrally registered metric instances.


Method Summary
static MetricsRegistry defaultRegistry()
          Returns the (static) default registry.
static Counter newCounter(java.lang.Class<?> klass, java.lang.String name)
          Creates a new Counter and registers it under the given class and name.
static Counter newCounter(java.lang.Class<?> klass, java.lang.String name, java.lang.String scope)
          Creates a new Counter and registers it under the given class and name.
static Counter newCounter(MetricName metricName)
          Creates a new Counter and registers it under the given metric name.
static
<T> Gauge<T>
newGauge(java.lang.Class<?> klass, java.lang.String name, Gauge<T> metric)
          Given a new Gauge, registers it under the given class and name.
static
<T> Gauge<T>
newGauge(java.lang.Class<?> klass, java.lang.String name, java.lang.String scope, Gauge<T> metric)
          Given a new Gauge, registers it under the given class and name.
static
<T> Gauge<T>
newGauge(MetricName metricName, Gauge<T> metric)
          Given a new Gauge, registers it under the given metric name.
static Histogram newHistogram(java.lang.Class<?> klass, java.lang.String name)
          Creates a new non-biased Histogram and registers it under the given class and name.
static Histogram newHistogram(java.lang.Class<?> klass, java.lang.String name, boolean biased)
          Creates a new Histogram and registers it under the given class and name.
static Histogram newHistogram(java.lang.Class<?> klass, java.lang.String name, java.lang.String scope)
          Creates a new non-biased Histogram and registers it under the given class, name, and scope.
static Histogram newHistogram(java.lang.Class<?> klass, java.lang.String name, java.lang.String scope, boolean biased)
          Creates a new Histogram and registers it under the given class, name, and scope.
static Histogram newHistogram(MetricName metricName)
          Creates a new non-biased Histogram and registers it under the given metric name.
static Histogram newHistogram(MetricName metricName, boolean biased)
          Creates a new Histogram and registers it under the given metric name.
static Meter newMeter(java.lang.Class<?> klass, java.lang.String name, java.lang.String scope, java.lang.String eventType, java.util.concurrent.TimeUnit unit)
          Creates a new Meter and registers it under the given class, name, and scope.
static Meter newMeter(java.lang.Class<?> klass, java.lang.String name, java.lang.String eventType, java.util.concurrent.TimeUnit unit)
          Creates a new Meter and registers it under the given class and name.
static Meter newMeter(MetricName metricName, java.lang.String eventType, java.util.concurrent.TimeUnit unit)
          Creates a new Meter and registers it under the given metric name.
static Timer newTimer(java.lang.Class<?> klass, java.lang.String name)
          Creates a new Timer and registers it under the given class and name, measuring elapsed time in milliseconds and invocations per second.
static Timer newTimer(java.lang.Class<?> klass, java.lang.String name, java.lang.String scope)
          Creates a new Timer and registers it under the given class, name, and scope, measuring elapsed time in milliseconds and invocations per second.
static Timer newTimer(java.lang.Class<?> klass, java.lang.String name, java.lang.String scope, java.util.concurrent.TimeUnit durationUnit, java.util.concurrent.TimeUnit rateUnit)
          Creates a new Timer and registers it under the given class, name, and scope.
static Timer newTimer(java.lang.Class<?> klass, java.lang.String name, java.util.concurrent.TimeUnit durationUnit, java.util.concurrent.TimeUnit rateUnit)
          Creates a new Timer and registers it under the given class and name.
static Timer newTimer(MetricName metricName, java.util.concurrent.TimeUnit durationUnit, java.util.concurrent.TimeUnit rateUnit)
          Creates a new Timer and registers it under the given metric name.
static void shutdown()
          Shuts down all thread pools for the default registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newGauge

public static <T> Gauge<T> newGauge(java.lang.Class<?> klass,
                                    java.lang.String name,
                                    Gauge<T> metric)
Given a new Gauge, registers it under the given class and name.

Type Parameters:
T - the type of the value returned by the metric
Parameters:
klass - the class which owns the metric
name - the name of the metric
metric - the metric
Returns:
metric

newGauge

public static <T> Gauge<T> newGauge(java.lang.Class<?> klass,
                                    java.lang.String name,
                                    java.lang.String scope,
                                    Gauge<T> metric)
Given a new Gauge, registers it under the given class and name.

Type Parameters:
T - the type of the value returned by the metric
Parameters:
klass - the class which owns the metric
name - the name of the metric
scope - the scope of the metric
metric - the metric
Returns:
metric

newGauge

public static <T> Gauge<T> newGauge(MetricName metricName,
                                    Gauge<T> metric)
Given a new Gauge, registers it under the given metric name.

Type Parameters:
T - the type of the value returned by the metric
Parameters:
metricName - the name of the metric
metric - the metric
Returns:
metric

newCounter

public static Counter newCounter(java.lang.Class<?> klass,
                                 java.lang.String name)
Creates a new Counter and registers it under the given class and name.

Parameters:
klass - the class which owns the metric
name - the name of the metric
Returns:
a new Counter

newCounter

public static Counter newCounter(java.lang.Class<?> klass,
                                 java.lang.String name,
                                 java.lang.String scope)
Creates a new Counter and registers it under the given class and name.

Parameters:
klass - the class which owns the metric
name - the name of the metric
scope - the scope of the metric
Returns:
a new Counter

newCounter

public static Counter newCounter(MetricName metricName)
Creates a new Counter and registers it under the given metric name.

Parameters:
metricName - the name of the metric
Returns:
a new Counter

newHistogram

public static Histogram newHistogram(java.lang.Class<?> klass,
                                     java.lang.String name,
                                     boolean biased)
Creates a new Histogram and registers it under the given class and name.

Parameters:
klass - the class which owns the metric
name - the name of the metric
biased - whether or not the histogram should be biased
Returns:
a new Histogram

newHistogram

public static Histogram newHistogram(java.lang.Class<?> klass,
                                     java.lang.String name,
                                     java.lang.String scope,
                                     boolean biased)
Creates a new Histogram and registers it under the given class, name, and scope.

Parameters:
klass - the class which owns the metric
name - the name of the metric
scope - the scope of the metric
biased - whether or not the histogram should be biased
Returns:
a new Histogram

newHistogram

public static Histogram newHistogram(MetricName metricName,
                                     boolean biased)
Creates a new Histogram and registers it under the given metric name.

Parameters:
metricName - the name of the metric
biased - whether or not the histogram should be biased
Returns:
a new Histogram

newHistogram

public static Histogram newHistogram(java.lang.Class<?> klass,
                                     java.lang.String name)
Creates a new non-biased Histogram and registers it under the given class and name.

Parameters:
klass - the class which owns the metric
name - the name of the metric
Returns:
a new Histogram

newHistogram

public static Histogram newHistogram(java.lang.Class<?> klass,
                                     java.lang.String name,
                                     java.lang.String scope)
Creates a new non-biased Histogram and registers it under the given class, name, and scope.

Parameters:
klass - the class which owns the metric
name - the name of the metric
scope - the scope of the metric
Returns:
a new Histogram

newHistogram

public static Histogram newHistogram(MetricName metricName)
Creates a new non-biased Histogram and registers it under the given metric name.

Parameters:
metricName - the name of the metric
Returns:
a new Histogram

newMeter

public static Meter newMeter(java.lang.Class<?> klass,
                             java.lang.String name,
                             java.lang.String eventType,
                             java.util.concurrent.TimeUnit unit)
Creates a new Meter and registers it under the given class and name.

Parameters:
klass - the class which owns the metric
name - the name of the metric
eventType - the plural name of the type of events the meter is measuring (e.g., "requests")
unit - the rate unit of the new meter
Returns:
a new Meter

newMeter

public static Meter newMeter(java.lang.Class<?> klass,
                             java.lang.String name,
                             java.lang.String scope,
                             java.lang.String eventType,
                             java.util.concurrent.TimeUnit unit)
Creates a new Meter and registers it under the given class, name, and scope.

Parameters:
klass - the class which owns the metric
name - the name of the metric
scope - the scope of the metric
eventType - the plural name of the type of events the meter is measuring (e.g., "requests")
unit - the rate unit of the new meter
Returns:
a new Meter

newMeter

public static Meter newMeter(MetricName metricName,
                             java.lang.String eventType,
                             java.util.concurrent.TimeUnit unit)
Creates a new Meter and registers it under the given metric name.

Parameters:
metricName - the name of the metric
eventType - the plural name of the type of events the meter is measuring (e.g., "requests")
unit - the rate unit of the new meter
Returns:
a new Meter

newTimer

public static Timer newTimer(java.lang.Class<?> klass,
                             java.lang.String name,
                             java.util.concurrent.TimeUnit durationUnit,
                             java.util.concurrent.TimeUnit rateUnit)
Creates a new Timer and registers it under the given class and name.

Parameters:
klass - the class which owns the metric
name - the name of the metric
durationUnit - the duration scale unit of the new timer
rateUnit - the rate scale unit of the new timer
Returns:
a new Timer

newTimer

public static Timer newTimer(java.lang.Class<?> klass,
                             java.lang.String name)
Creates a new Timer and registers it under the given class and name, measuring elapsed time in milliseconds and invocations per second.

Parameters:
klass - the class which owns the metric
name - the name of the metric
Returns:
a new Timer

newTimer

public static Timer newTimer(java.lang.Class<?> klass,
                             java.lang.String name,
                             java.lang.String scope,
                             java.util.concurrent.TimeUnit durationUnit,
                             java.util.concurrent.TimeUnit rateUnit)
Creates a new Timer and registers it under the given class, name, and scope.

Parameters:
klass - the class which owns the metric
name - the name of the metric
scope - the scope of the metric
durationUnit - the duration scale unit of the new timer
rateUnit - the rate scale unit of the new timer
Returns:
a new Timer

newTimer

public static Timer newTimer(java.lang.Class<?> klass,
                             java.lang.String name,
                             java.lang.String scope)
Creates a new Timer and registers it under the given class, name, and scope, measuring elapsed time in milliseconds and invocations per second.

Parameters:
klass - the class which owns the metric
name - the name of the metric
scope - the scope of the metric
Returns:
a new Timer

newTimer

public static Timer newTimer(MetricName metricName,
                             java.util.concurrent.TimeUnit durationUnit,
                             java.util.concurrent.TimeUnit rateUnit)
Creates a new Timer and registers it under the given metric name.

Parameters:
metricName - the name of the metric
durationUnit - the duration scale unit of the new timer
rateUnit - the rate scale unit of the new timer
Returns:
a new Timer

defaultRegistry

public static MetricsRegistry defaultRegistry()
Returns the (static) default registry.

Returns:
the metrics registry

shutdown

public static void shutdown()
Shuts down all thread pools for the default registry.


© 2006-2016 EsperTech Inc.
All rights reserved.
Visit us at espertech.com