Class NullMetricsProvider.NullMetricsContext
- java.lang.Object
-
- org.apache.zookeeper.metrics.impl.NullMetricsProvider.NullMetricsContext
-
- All Implemented Interfaces:
MetricsContext
- Enclosing class:
- NullMetricsProvider
public static final class NullMetricsProvider.NullMetricsContext extends Object implements MetricsContext
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.zookeeper.metrics.MetricsContext
MetricsContext.DetailLevel
-
-
Field Summary
Fields Modifier and Type Field Description static NullMetricsProvider.NullMetricsContext
INSTANCE
-
Constructor Summary
Constructors Constructor Description NullMetricsContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricsContext
getContext(String name)
Returns a sub context.Counter
getCounter(String name)
Returns a counter.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 providedGauge
which will be called by the MetricsProvider in order to sample an integer value.void
unregisterGauge(String name)
Unregisters the user providedGauge
bound to the given name.
-
-
-
Field Detail
-
INSTANCE
public static final NullMetricsProvider.NullMetricsContext INSTANCE
-
-
Method Detail
-
getContext
public MetricsContext getContext(String name)
Description copied from interface:MetricsContext
Returns a sub context.- Specified by:
getContext
in interfaceMetricsContext
- Parameters:
name
- the name of the subcontext- Returns:
- a new metrics context.
-
getCounter
public Counter getCounter(String name)
Description copied from interface:MetricsContext
Returns a counter.- Specified by:
getCounter
in interfaceMetricsContext
- Returns:
- the counter identified by name in this context.
-
registerGauge
public void registerGauge(String name, Gauge gauge)
Description copied from interface:MetricsContext
Registers an user providedGauge
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.- Specified by:
registerGauge
in interfaceMetricsContext
- Parameters:
name
- unique name of the Gauge in this contextgauge
- the implementation of the Gauge
-
unregisterGauge
public void unregisterGauge(String name)
Description copied from interface:MetricsContext
Unregisters the user providedGauge
bound to the given name.- Specified by:
unregisterGauge
in interfaceMetricsContext
- Parameters:
name
- unique name of the Gauge in this context
-
getSummary
public Summary getSummary(String name, MetricsContext.DetailLevel detailLevel)
Description copied from interface:MetricsContext
Returns a summary.- Specified by:
getSummary
in interfaceMetricsContext
- Returns:
- the summary identified by name in this context.
-
getSummarySet
public SummarySet getSummarySet(String name, MetricsContext.DetailLevel detailLevel)
Description copied from interface:MetricsContext
Returns a set of summaries.- Specified by:
getSummarySet
in interfaceMetricsContext
- Returns:
- the summary identified by name in this context.
-
-