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.MetricsContextMetricsContext.DetailLevel
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static NullMetricsProvider.NullMetricsContextINSTANCE
 - 
Constructor SummaryConstructors Constructor Description NullMetricsContext()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricsContextgetContext(String name)Returns a sub context.CountergetCounter(String name)Returns a counter.CounterSetgetCounterSet(String name)Returns the CounterSet identified by the given name Null name is not allowedSummarygetSummary(String name, MetricsContext.DetailLevel detailLevel)Returns a summary.SummarySetgetSummarySet(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 Detail- 
INSTANCEpublic static final NullMetricsProvider.NullMetricsContext INSTANCE 
 
- 
 - 
Method Detail- 
getContextpublic MetricsContext getContext(String name) Description copied from interface:MetricsContextReturns a sub context.- Specified by:
- getContextin interface- MetricsContext
- Parameters:
- name- the name of the subcontext
- Returns:
- a new metrics context.
 
 - 
getCounterpublic Counter getCounter(String name) Description copied from interface:MetricsContextReturns a counter.- Specified by:
- getCounterin interface- MetricsContext
- Returns:
- the counter identified by name in this context.
 
 - 
getCounterSetpublic CounterSet getCounterSet(String name) Description copied from interface:MetricsContextReturns the CounterSet identified by the given name Null name is not allowed- Specified by:
- getCounterSetin interface- MetricsContext
- Returns:
- CounterSet identified by the name in this context.
 
 - 
registerGaugepublic void registerGauge(String name, Gauge gauge) 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 interface- MetricsContext
- Parameters:
- name- unique name of the Gauge in this context
- gauge- the implementation of the Gauge
 
 - 
unregisterGaugepublic void unregisterGauge(String name) Description copied from interface:MetricsContextUnregisters the user providedGaugebound to the given name.- Specified by:
- unregisterGaugein interface- MetricsContext
- Parameters:
- name- unique name of the Gauge in this context
 
 - 
registerGaugeSetpublic void registerGaugeSet(String name, GaugeSet gaugeSet) 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 interface- MetricsContext
- Parameters:
- name- unique name of the GaugeSet in this context
- gaugeSet- the implementation of the GaugeSet
 
 - 
unregisterGaugeSetpublic void unregisterGaugeSet(String name) Description copied from interface:MetricsContextUnregisters the user providedGaugeSetbound to the given name. Unregistering with a null name is not allowed.- Specified by:
- unregisterGaugeSetin interface- MetricsContext
- Parameters:
- name- unique name of the GaugeSet in this context
 
 - 
getSummarypublic Summary getSummary(String name, MetricsContext.DetailLevel detailLevel) Description copied from interface:MetricsContextReturns a summary.- Specified by:
- getSummaryin interface- MetricsContext
- Returns:
- the summary identified by name in this context.
 
 - 
getSummarySetpublic SummarySet getSummarySet(String name, MetricsContext.DetailLevel detailLevel) Description copied from interface:MetricsContextReturns a set of summaries.- Specified by:
- getSummarySetin interface- MetricsContext
- Returns:
- the summary identified by name in this context.
 
 
- 
 
-