Class NullMetricsProvider
java.lang.Object
org.apache.zookeeper.metrics.impl.NullMetricsProvider
- All Implemented Interfaces:
MetricsProvider
This is a dummy MetricsProvider which does nothing.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MetricsProvider
Instance of NullMetricsProvider useful for tests. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Properties configuration) Configure the provider.void
dump
(BiConsumer<String, Object> sink) Dumps all metrics as a key-value pair.Provides access to the root context.void
Reset all values.void
start()
Start the provider.void
stop()
Releases resources held by the provider.
This method must not throw exceptions.
This method can be called more than once.
-
Field Details
-
INSTANCE
Instance of NullMetricsProvider useful for tests.
-
-
Constructor Details
-
NullMetricsProvider
public NullMetricsProvider()
-
-
Method Details
-
configure
Description copied from interface:MetricsProvider
Configure the provider.- Specified by:
configure
in interfaceMetricsProvider
- Parameters:
configuration
- the configuration.- Throws:
MetricsProviderLifeCycleException
- in case of invalid configuration.
-
start
Description copied from interface:MetricsProvider
Start the provider. For instance such method will start a network endpoint.- Specified by:
start
in interfaceMetricsProvider
- Throws:
MetricsProviderLifeCycleException
- in case of failure
-
getRootContext
Description copied from interface:MetricsProvider
Provides access to the root context.- Specified by:
getRootContext
in interfaceMetricsProvider
- Returns:
- the root context
-
dump
Description copied from interface:MetricsProvider
Dumps all metrics as a key-value pair. This method will be used in legacy monitor command.- Specified by:
dump
in interfaceMetricsProvider
- Parameters:
sink
- the receiver of all of the current values.
-
resetAllValues
public void resetAllValues()Description copied from interface:MetricsProvider
Reset all values. This method is optional and can be noop, depending on the underlying implementation.- Specified by:
resetAllValues
in interfaceMetricsProvider
-
stop
public void stop()Description copied from interface:MetricsProvider
Releases resources held by the provider.
This method must not throw exceptions.
This method can be called more than once.- Specified by:
stop
in interfaceMetricsProvider
-