public interface MetricsContext
extends java.io.Serializable
Modifier and Type | Interface and Description |
---|---|
static interface |
MetricsContext.Counter<T extends java.lang.Number>
Deprecated.
will be removed in 2.0.0, use
Counter instead. |
static class |
MetricsContext.Unit |
Modifier and Type | Method and Description |
---|---|
default Counter |
counter(java.lang.String name)
Get a named counter using
MetricsContext.Unit.COUNT |
default <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(String, Unit) instead. |
default Counter |
counter(java.lang.String name,
MetricsContext.Unit unit)
Get a named counter.
|
default Histogram |
histogram(java.lang.String name) |
default void |
initialize(java.util.Map<java.lang.String,java.lang.String> properties) |
static MetricsContext |
nullMetrics()
Utility method for producing no metrics.
|
default Timer |
timer(java.lang.String name,
java.util.concurrent.TimeUnit unit)
Get a named timer.
|
default void initialize(java.util.Map<java.lang.String,java.lang.String> properties)
@Deprecated default <T extends java.lang.Number> MetricsContext.Counter<T> counter(java.lang.String name, java.lang.Class<T> type, MetricsContext.Unit unit)
counter(String, Unit)
instead.name
- name of the metrictype
- numeric type of the counter valueunit
- the unit designation of the metricdefault Counter counter(java.lang.String name, MetricsContext.Unit unit)
name
- The name of the counterunit
- The unit designation of the counterCounter
implementationdefault Counter counter(java.lang.String name)
MetricsContext.Unit.COUNT
name
- The name of the counterCounter
implementationdefault Timer timer(java.lang.String name, java.util.concurrent.TimeUnit unit)
name
- name of the metricunit
- the time unit designation of the metricdefault Histogram histogram(java.lang.String name)
static MetricsContext nullMetrics()