Class DefaultMetricsProvider
java.lang.Object
org.apache.zookeeper.metrics.impl.DefaultMetricsProvider
- All Implemented Interfaces:
MetricsProvider
Default implementation of
It does not implement a real hierarchy of contexts, but metrics are flattened in a single namespace.
It is mostly useful to make the legacy 4 letter words interface work as expected.
MetricsProvider.It does not implement a real hierarchy of contexts, but metrics are flattened in a single namespace.
It is mostly useful to make the legacy 4 letter words interface work as expected.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Properties configuration) Configure the provider.voiddump(BiConsumer<String, Object> sink) Dumps all metrics as a key-value pair.Provides access to the root context.voidReset 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.
-
Constructor Details
-
DefaultMetricsProvider
public DefaultMetricsProvider()
-
-
Method Details
-
configure
Description copied from interface:MetricsProviderConfigure the provider.- Specified by:
configurein interfaceMetricsProvider- Parameters:
configuration- the configuration.- Throws:
MetricsProviderLifeCycleException- in case of invalid configuration.
-
start
Description copied from interface:MetricsProviderStart the provider. For instance such method will start a network endpoint.- Specified by:
startin interfaceMetricsProvider- Throws:
MetricsProviderLifeCycleException- in case of failure
-
getRootContext
Description copied from interface:MetricsProviderProvides access to the root context.- Specified by:
getRootContextin interfaceMetricsProvider- Returns:
- the root context
-
stop
public 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 interfaceMetricsProvider
-
dump
Description copied from interface:MetricsProviderDumps all metrics as a key-value pair. This method will be used in legacy monitor command.- Specified by:
dumpin interfaceMetricsProvider- Parameters:
sink- the receiver of all of the current values.
-
resetAllValues
public 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 interfaceMetricsProvider
-