|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.yammer.metrics.Metrics
public class Metrics
A set of factory methods for creating centrally registered metric instances.
| Method Summary | ||
|---|---|---|
static Map<MetricName,Metric> |
allMetrics()
Returns an unmodifiable map of all metrics and their names. |
|
static MetricsRegistry |
defaultRegistry()
Returns the (static) default registry. |
|
static void |
enableConsoleReporting(long period,
TimeUnit unit)
Deprecated. use ConsoleReporter.enable(long, java.util.concurrent.TimeUnit) instead |
|
static CounterMetric |
newCounter(Class<?> klass,
String name)
Creates a new CounterMetric and registers it under the given class and name. |
|
static CounterMetric |
newCounter(Class<?> klass,
String name,
String scope)
Creates a new CounterMetric and registers it under the given class and name. |
|
static CounterMetric |
newCounter(MetricName metricName)
Creates a new CounterMetric and registers it under the given metric name. |
|
static
|
newGauge(Class<?> klass,
String name,
GaugeMetric<T> metric)
Given a new GaugeMetric, registers it under the given class and name. |
|
static
|
newGauge(Class<?> klass,
String name,
String scope,
GaugeMetric<T> metric)
Given a new GaugeMetric, registers it under the given class and name. |
|
static
|
newGauge(MetricName metricName,
GaugeMetric<T> metric)
Given a new GaugeMetric, registers it under the given metric name. |
|
static HistogramMetric |
newHistogram(Class<?> klass,
String name)
Creates a new non-biased HistogramMetric and registers it under the given class and
name. |
|
static HistogramMetric |
newHistogram(Class<?> klass,
String name,
boolean biased)
Creates a new HistogramMetric and registers it under the given class and name. |
|
static HistogramMetric |
newHistogram(Class<?> klass,
String name,
String scope)
Creates a new non-biased HistogramMetric and registers it under the given class,
name, and scope. |
|
static HistogramMetric |
newHistogram(Class<?> klass,
String name,
String scope,
boolean biased)
Creates a new HistogramMetric and registers it under the given class, name, and
scope. |
|
static HistogramMetric |
newHistogram(MetricName metricName)
Creates a new non-biased HistogramMetric and registers it under the given metric
name. |
|
static HistogramMetric |
newHistogram(MetricName metricName,
boolean biased)
Creates a new HistogramMetric and registers it under the given metric name. |
|
static JmxGauge |
newJmxGauge(Class<?> klass,
String name,
String objectName,
String attribute)
Given a JMX MBean's object name and an attribute name, registers a gauge for that attribute under the given class and name. |
|
static JmxGauge |
newJmxGauge(Class<?> klass,
String name,
String scope,
String objectName,
String attribute)
Given a JMX MBean's object name and an attribute name, registers a gauge for that attribute under the given class, name, and scope. |
|
static JmxGauge |
newJmxGauge(MetricName metricName,
String objectName,
String attribute)
Given a JMX MBean's object name and an attribute name, registers a gauge for that attribute under the given metric name. |
|
static MeterMetric |
newMeter(Class<?> klass,
String name,
String scope,
String eventType,
TimeUnit unit)
Creates a new MeterMetric and registers it under the given class, name, and scope. |
|
static MeterMetric |
newMeter(Class<?> klass,
String name,
String eventType,
TimeUnit unit)
Creates a new MeterMetric and registers it under the given class and name. |
|
static MeterMetric |
newMeter(MetricName metricName,
String eventType,
TimeUnit unit)
Creates a new MeterMetric and registers it under the given metric name. |
|
static TimerMetric |
newTimer(Class<?> klass,
String name)
Creates a new TimerMetric and registers it under the given class and name, measuring
elapsed time in milliseconds and invocations per second. |
|
static TimerMetric |
newTimer(Class<?> klass,
String name,
String scope)
Creates a new TimerMetric and registers it under the given class, name, and scope,
measuring elapsed time in milliseconds and invocations per second. |
|
static TimerMetric |
newTimer(Class<?> klass,
String name,
String scope,
TimeUnit durationUnit,
TimeUnit rateUnit)
Creates a new TimerMetric and registers it under the given class, name, and scope. |
|
static TimerMetric |
newTimer(Class<?> klass,
String name,
TimeUnit durationUnit,
TimeUnit rateUnit)
Creates a new TimerMetric and registers it under the given class and name. |
|
static TimerMetric |
newTimer(MetricName metricName,
TimeUnit durationUnit,
TimeUnit rateUnit)
Creates a new TimerMetric and registers it under the given metric name. |
|
static void |
removeMetric(Class<?> klass,
String name)
Removes the metric for the given class with the given name. |
|
static void |
removeMetric(Class<?> klass,
String name,
String scope)
Removes the metric for the given class with the given name and scope. |
|
static void |
removeMetric(MetricName name)
Removes the metric with the given name. |
|
static void |
shutdown()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> GaugeMetric<T> newGauge(Class<?> klass,
String name,
GaugeMetric<T> metric)
GaugeMetric, registers it under the given class and name.
T - the type of the value returned by the metricklass - the class which owns the metricname - the name of the metricmetric - the metric
metric
public static <T> GaugeMetric<T> newGauge(Class<?> klass,
String name,
String scope,
GaugeMetric<T> metric)
GaugeMetric, registers it under the given class and name.
T - the type of the value returned by the metricklass - the class which owns the metricname - the name of the metricscope - the scope of the metricmetric - the metric
metric
public static <T> GaugeMetric<T> newGauge(MetricName metricName,
GaugeMetric<T> metric)
GaugeMetric, registers it under the given metric name.
T - the type of the value returned by the metricmetricName - the name of the metricmetric - the metric
metric
public static JmxGauge newJmxGauge(Class<?> klass,
String name,
String objectName,
String attribute)
throws MalformedObjectNameException
klass - the class which owns the metricname - the name of the metricobjectName - the object name of the MBeanattribute - the name of the bean's attribute
JmxGauge
MalformedObjectNameException - if the object name is malformed
public static JmxGauge newJmxGauge(Class<?> klass,
String name,
String scope,
String objectName,
String attribute)
throws MalformedObjectNameException
klass - the class which owns the metricname - the name of the metricscope - the scope of the metricobjectName - the object name of the MBeanattribute - the name of the bean's attribute
JmxGauge
MalformedObjectNameException - if the object name is malformed
public static JmxGauge newJmxGauge(MetricName metricName,
String objectName,
String attribute)
throws MalformedObjectNameException
metricName - the name of the metricobjectName - the object name of the MBeanattribute - the name of the bean's attribute
JmxGauge
MalformedObjectNameException - if the object name is malformed
public static CounterMetric newCounter(Class<?> klass,
String name)
CounterMetric and registers it under the given class and name.
klass - the class which owns the metricname - the name of the metric
CounterMetric
public static CounterMetric newCounter(Class<?> klass,
String name,
String scope)
CounterMetric and registers it under the given class and name.
klass - the class which owns the metricname - the name of the metricscope - the scope of the metric
CounterMetricpublic static CounterMetric newCounter(MetricName metricName)
CounterMetric and registers it under the given metric name.
metricName - the name of the metric
CounterMetric
public static HistogramMetric newHistogram(Class<?> klass,
String name,
boolean biased)
HistogramMetric and registers it under the given class and name.
klass - the class which owns the metricname - the name of the metricbiased - whether or not the histogram should be biased
HistogramMetric
public static HistogramMetric newHistogram(Class<?> klass,
String name,
String scope,
boolean biased)
HistogramMetric and registers it under the given class, name, and
scope.
klass - the class which owns the metricname - the name of the metricscope - the scope of the metricbiased - whether or not the histogram should be biased
HistogramMetric
public static HistogramMetric newHistogram(MetricName metricName,
boolean biased)
HistogramMetric and registers it under the given metric name.
metricName - the name of the metricbiased - whether or not the histogram should be biased
HistogramMetric
public static HistogramMetric newHistogram(Class<?> klass,
String name)
HistogramMetric and registers it under the given class and
name.
klass - the class which owns the metricname - the name of the metric
HistogramMetric
public static HistogramMetric newHistogram(Class<?> klass,
String name,
String scope)
HistogramMetric and registers it under the given class,
name, and scope.
klass - the class which owns the metricname - the name of the metricscope - the scope of the metric
HistogramMetricpublic static HistogramMetric newHistogram(MetricName metricName)
HistogramMetric and registers it under the given metric
name.
metricName - the name of the metric
HistogramMetric
public static MeterMetric newMeter(Class<?> klass,
String name,
String eventType,
TimeUnit unit)
MeterMetric and registers it under the given class and name.
klass - the class which owns the metricname - the name of the metriceventType - the plural name of the type of events the meter is measuring (e.g., "requests")unit - the rate unit of the new meter
MeterMetric
public static MeterMetric newMeter(Class<?> klass,
String name,
String scope,
String eventType,
TimeUnit unit)
MeterMetric and registers it under the given class, name, and scope.
klass - the class which owns the metricname - the name of the metricscope - the scope of the metriceventType - the plural name of the type of events the meter is measuring (e.g., "requests")unit - the rate unit of the new meter
MeterMetric
public static MeterMetric newMeter(MetricName metricName,
String eventType,
TimeUnit unit)
MeterMetric and registers it under the given metric name.
metricName - the name of the metriceventType - the plural name of the type of events the meter is measuring (e.g., "requests")unit - the rate unit of the new meter
MeterMetric
public static TimerMetric newTimer(Class<?> klass,
String name,
TimeUnit durationUnit,
TimeUnit rateUnit)
TimerMetric and registers it under the given class and name.
klass - the class which owns the metricname - the name of the metricdurationUnit - the duration scale unit of the new timerrateUnit - the rate scale unit of the new timer
TimerMetric
public static TimerMetric newTimer(Class<?> klass,
String name)
TimerMetric and registers it under the given class and name, measuring
elapsed time in milliseconds and invocations per second.
klass - the class which owns the metricname - the name of the metric
TimerMetric
public static TimerMetric newTimer(Class<?> klass,
String name,
String scope,
TimeUnit durationUnit,
TimeUnit rateUnit)
TimerMetric and registers it under the given class, name, and scope.
klass - the class which owns the metricname - the name of the metricscope - the scope of the metricdurationUnit - the duration scale unit of the new timerrateUnit - the rate scale unit of the new timer
TimerMetric
public static TimerMetric newTimer(Class<?> klass,
String name,
String scope)
TimerMetric and registers it under the given class, name, and scope,
measuring elapsed time in milliseconds and invocations per second.
klass - the class which owns the metricname - the name of the metricscope - the scope of the metric
TimerMetric
public static TimerMetric newTimer(MetricName metricName,
TimeUnit durationUnit,
TimeUnit rateUnit)
TimerMetric and registers it under the given metric name.
metricName - the name of the metricdurationUnit - the duration scale unit of the new timerrateUnit - the rate scale unit of the new timer
TimerMetricpublic static void removeMetric(MetricName name)
name - the name of the metric
public static void removeMetric(Class<?> klass,
String name)
klass - the klass the metric is associated withname - the name of the metric
public static void removeMetric(Class<?> klass,
String name,
String scope)
klass - the klass the metric is associated withname - the name of the metricscope - the scope of the metric
@Deprecated
public static void enableConsoleReporting(long period,
TimeUnit unit)
ConsoleReporter.enable(long, java.util.concurrent.TimeUnit) instead
period - the period between successive outputsunit - the time unit of periodpublic static Map<MetricName,Metric> allMetrics()
public static MetricsRegistry defaultRegistry()
public static void shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||