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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContext(String name) Returns a sub context.getCounter(String name) Returns a counter.getCounterSet(String name) Returns the CounterSet identified by the given name Null name is not allowedgetSummary(String name, MetricsContext.DetailLevel detailLevel) Returns a summary.getSummarySet(String name, MetricsContext.DetailLevel detailLevel) Returns a set of summaries.voidregisterGauge(String name, Gauge gauge) Registers an user providedGaugewhich will be called by the MetricsProvider in order to sample an integer value.voidregisterGaugeSet(String name, GaugeSet gaugeSet) Registers a user providedGaugeSetwhich will be called by the MetricsProvider in order to sample number values.voidunregisterGauge(String name) Unregisters the user providedGaugebound to the given name.voidunregisterGaugeSet(String name) Unregisters the user providedGaugeSetbound to the given name.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NullMetricsContext
public NullMetricsContext()
-
-
Method Details
-
getContext
Description copied from interface:MetricsContextReturns a sub context.- Specified by:
getContextin interfaceMetricsContext- Parameters:
name- the name of the subcontext- Returns:
- a new metrics context.
-
getCounter
Description copied from interface:MetricsContextReturns a counter.- Specified by:
getCounterin interfaceMetricsContext- Returns:
- the counter identified by name in this context.
-
getCounterSet
Description copied from interface:MetricsContextReturns the CounterSet identified by the given name Null name is not allowed- Specified by:
getCounterSetin interfaceMetricsContext- Returns:
- CounterSet identified by the name in this context.
-
registerGauge
Description copied from interface:MetricsContextRegisters an user providedGaugewhich 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:
registerGaugein interfaceMetricsContext- Parameters:
name- unique name of the Gauge in this contextgauge- the implementation of the Gauge
-
unregisterGauge
Description copied from interface:MetricsContextUnregisters the user providedGaugebound to the given name.- Specified by:
unregisterGaugein interfaceMetricsContext- Parameters:
name- unique name of the Gauge in this context
-
registerGaugeSet
Description copied from interface:MetricsContextRegisters a user providedGaugeSetwhich 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.- Specified by:
registerGaugeSetin interfaceMetricsContext- Parameters:
name- unique name of the GaugeSet in this contextgaugeSet- the implementation of the GaugeSet
-
unregisterGaugeSet
Description copied from interface:MetricsContextUnregisters the user providedGaugeSetbound to the given name. Unregistering with a null name is not allowed.- Specified by:
unregisterGaugeSetin interfaceMetricsContext- Parameters:
name- unique name of the GaugeSet in this context
-
getSummary
Description copied from interface:MetricsContextReturns a summary.- Specified by:
getSummaryin interfaceMetricsContext- Returns:
- the summary identified by name in this context.
-
getSummarySet
Description copied from interface:MetricsContextReturns a set of summaries.- Specified by:
getSummarySetin interfaceMetricsContext- Returns:
- the summary identified by name in this context.
-