Class NullMetricsProvider
- java.lang.Object
- 
- org.apache.zookeeper.metrics.impl.NullMetricsProvider
 
- 
- All Implemented Interfaces:
- MetricsProvider
 
 public class NullMetricsProvider extends Object implements MetricsProvider This is a dummy MetricsProvider which does nothing.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classNullMetricsProvider.NullMetricsContext
 - 
Field SummaryFields Modifier and Type Field Description static MetricsProviderINSTANCEInstance of NullMetricsProvider useful for tests.
 - 
Constructor SummaryConstructors Constructor Description NullMetricsProvider()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Properties configuration)Configure the provider.voiddump(BiConsumer<String,Object> sink)Dumps all metrics as a key-value pair.MetricsContextgetRootContext()Provides access to the root context.voidresetAllValues()Reset all values.voidstart()Start the provider.voidstop()Releases resources held by the provider.
 This method must not throw exceptions.
 This method can be called more than once.
 
- 
- 
- 
Field Detail- 
INSTANCEpublic static final MetricsProvider INSTANCE Instance of NullMetricsProvider useful for tests.
 
- 
 - 
Method Detail- 
configurepublic void configure(Properties configuration) throws MetricsProviderLifeCycleException Description copied from interface:MetricsProviderConfigure the provider.- Specified by:
- configurein interface- MetricsProvider
- Parameters:
- configuration- the configuration.
- Throws:
- MetricsProviderLifeCycleException- in case of invalid configuration.
 
 - 
startpublic void start() throws MetricsProviderLifeCycleExceptionDescription copied from interface:MetricsProviderStart the provider. For instance such method will start a network endpoint.- Specified by:
- startin interface- MetricsProvider
- Throws:
- MetricsProviderLifeCycleException- in case of failure
 
 - 
getRootContextpublic MetricsContext getRootContext() Description copied from interface:MetricsProviderProvides access to the root context.- Specified by:
- getRootContextin interface- MetricsProvider
- Returns:
- the root context
 
 - 
dumppublic void dump(BiConsumer<String,Object> sink) Description copied from interface:MetricsProviderDumps all metrics as a key-value pair. This method will be used in legacy monitor command.- Specified by:
- dumpin interface- MetricsProvider
- Parameters:
- sink- the receiver of all of the current values.
 
 - 
resetAllValuespublic void resetAllValues() Description copied from interface:MetricsProviderReset all values. This method is optional and can be noop, depending on the underlying implementation.- Specified by:
- resetAllValuesin interface- MetricsProvider
 
 - 
stoppublic void stop() Description copied from interface:MetricsProviderReleases resources held by the provider.
 This method must not throw exceptions.
 This method can be called more than once.- Specified by:
- stopin interface- MetricsProvider
 
 
- 
 
-