public class DefaultMetricsContext extends java.lang.Object implements MetricsContext
MetricsContext
implementation that uses native Java counters/timers.MetricsContext.Counter<T extends java.lang.Number>, MetricsContext.Unit
Constructor and Description |
---|
DefaultMetricsContext() |
Modifier and Type | Method and Description |
---|---|
<T extends java.lang.Number> |
counter(java.lang.String name,
java.lang.Class<T> type,
MetricsContext.Unit unit)
Deprecated.
will be removed in 2.0.0, use
Counter instead. |
Counter |
counter(java.lang.String name,
MetricsContext.Unit unit)
Get a named counter.
|
Histogram |
histogram(java.lang.String name) |
Timer |
timer(java.lang.String name,
java.util.concurrent.TimeUnit unit)
Get a named timer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
counter, initialize, nullMetrics
@Deprecated public <T extends java.lang.Number> MetricsContext.Counter<T> counter(java.lang.String name, java.lang.Class<T> type, MetricsContext.Unit unit)
Counter
instead.MetricsContext
counter
in interface MetricsContext
name
- name of the metrictype
- numeric type of the counter valueunit
- the unit designation of the metricpublic Timer timer(java.lang.String name, java.util.concurrent.TimeUnit unit)
MetricsContext
timer
in interface MetricsContext
name
- name of the metricunit
- the time unit designation of the metricpublic Counter counter(java.lang.String name, MetricsContext.Unit unit)
MetricsContext
counter
in interface MetricsContext
name
- The name of the counterunit
- The unit designation of the counterCounter
implementationpublic Histogram histogram(java.lang.String name)
histogram
in interface MetricsContext