# 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 MetricsContext

`MetricsContext.DetailLevel`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final NullMetricsProvider.NullMetricsContext`
`INSTANCE`

## Constructor Summary

Constructors
Constructor
Description
`NullMetricsContext()`

## Method Summary

Modifier and Type
Method
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.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### INSTANCE

public static final NullMetricsProvider.NullMetricsContext INSTANCE

## Constructor Details

### NullMetricsContext

public NullMetricsContext()

## Method Details

### getContext

public MetricsContext getContext(String name)
Description copied from interface: `MetricsContext`
Returns a sub context.

Specified by:
  `getContext` in interface `MetricsContext`
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 interface `MetricsContext`
Parameters:
  `name` -
Returns:
  the counter identified by name in this context.

### getCounterSet

public CounterSet getCounterSet(String name)
Description copied from interface: `MetricsContext`
Returns the CounterSet identified by the given name Null name is not allowed

Specified by:
  `getCounterSet` in interface `MetricsContext`
Parameters:
  `name` -
Returns:
  CounterSet identified by the name in this context.

### registerGauge

public void registerGauge(String name, Gauge gauge)
Description copied from interface: `MetricsContext`
Registers an user provided `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.

Specified by:
  `registerGauge` in interface `MetricsContext`
Parameters:
  `name` - unique name of the Gauge in this context
  `gauge` - the implementation of the Gauge

### unregisterGauge

public void unregisterGauge(String name)
Description copied from interface: `MetricsContext`
Unregisters the user provided `Gauge` bound to the given name.

Specified by:
  `unregisterGauge` in interface `MetricsContext`
Parameters:
  `name` - unique name of the Gauge in this context

### registerGaugeSet

public void registerGaugeSet(String name, GaugeSet gaugeSet)
Description copied from interface: `MetricsContext`
Registers a user provided `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.

Specified by:
  `registerGaugeSet` in interface `MetricsContext`
Parameters:
  `name` - unique name of the GaugeSet in this context
  `gaugeSet` - the implementation of the GaugeSet

### unregisterGaugeSet

public void unregisterGaugeSet(String name)
Description copied from interface: `MetricsContext`
Unregisters the user provided `GaugeSet` bound to the given name. Unregistering with a null name is not allowed.

Specified by:
  `unregisterGaugeSet` in interface `MetricsContext`
Parameters:
  `name` - unique name of the GaugeSet in this context

### getSummary

public Summary getSummary(String name, MetricsContext.DetailLevel detailLevel)
Description copied from interface: `MetricsContext`
Returns a summary.

Specified by:
  `getSummary` in interface `MetricsContext`
Parameters:
  `name` -
  `detailLevel` -
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 interface `MetricsContext`
Parameters:
  `name` -
  `detailLevel` -
Returns:
  the summary identified by name in this context.