public class NullMetricsProvider extends Object implements MetricsProvider
Modifier and Type | Class and Description |
---|---|
static class |
NullMetricsProvider.NullMetricsContext |
Modifier and Type | Field and Description |
---|---|
static MetricsProvider |
INSTANCE
Instance of NullMetricsProvider useful for tests.
|
Constructor and Description |
---|
NullMetricsProvider() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Properties configuration)
Configure the provider.
|
void |
dump(BiConsumer<String,Object> sink)
Dumps all metrics as a key-value pair.
|
MetricsContext |
getRootContext()
Provides access to the root context.
|
void |
resetAllValues()
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. |
public static final MetricsProvider INSTANCE
public void configure(Properties configuration) throws MetricsProviderLifeCycleException
MetricsProvider
configure
in interface MetricsProvider
configuration
- the configuration.MetricsProviderLifeCycleException
- in case of invalid configuration.public void start() throws MetricsProviderLifeCycleException
MetricsProvider
start
in interface MetricsProvider
MetricsProviderLifeCycleException
- in case of failurepublic MetricsContext getRootContext()
MetricsProvider
getRootContext
in interface MetricsProvider
public void dump(BiConsumer<String,Object> sink)
MetricsProvider
dump
in interface MetricsProvider
sink
- the receiver of all of the current values.public void resetAllValues()
MetricsProvider
resetAllValues
in interface MetricsProvider
public void stop()
MetricsProvider
stop
in interface MetricsProvider
Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.