NullMetricsProvider (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.metrics.impl

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

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `NullMetricsProvider.NullMetricsContext`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static MetricsProvider` | `INSTANCE` Instance of NullMetricsProvider useful for tests.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NullMetricsProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### INSTANCE

          public static final MetricsProvider INSTANCE

      Instance of NullMetricsProvider useful for tests.

  - ### Constructor Detail

    - #### NullMetricsProvider

          public NullMetricsProvider()

  - ### Method Detail

    - #### configure

          public void configure(Properties configuration)
                         throws MetricsProviderLifeCycleException

      Description copied from interface: `MetricsProvider`
      Configure the provider.
      Specified by:
        `configure` in interface `MetricsProvider`
      Parameters:
        `configuration` - the configuration.
      Throws:
        `MetricsProviderLifeCycleException` - in case of invalid configuration.

    - #### start

          public void start()
                     throws MetricsProviderLifeCycleException

      Description copied from interface: `MetricsProvider`
      Start the provider. For instance such method will start a network endpoint.
      Specified by:
        `start` in interface `MetricsProvider`
      Throws:
        `MetricsProviderLifeCycleException` - in case of failure

    - #### getRootContext

          public MetricsContext getRootContext()

      Description copied from interface: `MetricsProvider`
      Provides access to the root context.
      Specified by:
        `getRootContext` in interface `MetricsProvider`
      Returns:
        the root context

    - #### dump

          public void dump(BiConsumer<String,Object> sink)

      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 interface `MetricsProvider`
      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 interface `MetricsProvider`

    - #### 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 interface `MetricsProvider`

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.