public interface MetricsContext
In some cases it is possible to have a separate MetricsContext for each instance of a component, for instance on the server side a possible usecase it to gather metrics for every other peer.
Contexts are organized in a hierarchy.
Modifier and Type | Interface and Description |
---|---|
static class |
MetricsContext.DetailLevel |
Modifier and Type | Method and Description |
---|---|
MetricsContext |
getContext(String name)
Returns a sub context.
|
Counter |
getCounter(String name)
Returns a counter.
|
CounterSet |
getCounterSet(String name)
Returns the CounterSet identified by the given name
Null name is not allowed
|
Summary |
getSummary(String name,
MetricsContext.DetailLevel detailLevel)
Returns a summary.
|
SummarySet |
getSummarySet(String name,
MetricsContext.DetailLevel detailLevel)
Returns a set of summaries.
|
void |
registerGauge(String name,
Gauge gauge)
Registers an user provided
Gauge which will be called by the
MetricsProvider in order to sample an integer value. |
void |
registerGaugeSet(String name,
GaugeSet gaugeSet)
Registers a user provided
GaugeSet which will be called by the
MetricsProvider in order to sample number values. |
void |
unregisterGauge(String name)
Unregisters the user provided
Gauge bound to the given name. |
void |
unregisterGaugeSet(String name)
Unregisters the user provided
GaugeSet bound to the given name. |
MetricsContext getContext(String name)
name
- the name of the subcontextCounter getCounter(String name)
name
- CounterSet getCounterSet(String name)
name
- void registerGauge(String name, Gauge gauge)
Gauge
which will be called by the
MetricsProvider in order to sample an integer value.
If another Gauge was already registered the new one will
take its place.
Registering a null callback is not allowed.name
- unique name of the Gauge in this contextgauge
- the implementation of the Gaugevoid unregisterGauge(String name)
Gauge
bound to the given name.name
- unique name of the Gauge in this contextvoid registerGaugeSet(String name, GaugeSet gaugeSet)
GaugeSet
which will be called by the
MetricsProvider in order to sample number values.
If another GaugeSet was already registered, the new one will take its place.
Registering with a null name or null callback is not allowed.name
- unique name of the GaugeSet in this contextgaugeSet
- the implementation of the GaugeSetvoid unregisterGaugeSet(String name)
GaugeSet
bound to the given name.
Unregistering with a null name is not allowed.name
- unique name of the GaugeSet in this contextSummary getSummary(String name, MetricsContext.DetailLevel detailLevel)
name
- detailLevel
- SummarySet getSummarySet(String name, MetricsContext.DetailLevel detailLevel)
name
- detailLevel
- Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.