Interface MetricsProvider

  • All Known Implementing Classes:
    DefaultMetricsProvider, NullMetricsProvider

    public interface MetricsProvider
    A MetricsProvider is a system which collects Metrics and publishes current values to external facilities. The system will create an instance of the configured class using the default constructor, which must be public.
    After the instantiation of the provider, the system will call configure(java.util.Properties) in order to provide configuration, and then when the system is ready to work it will call start().
    Providers can be used both on ZooKeeper servers and on ZooKeeper clients.
    • Method Detail

      • getRootContext

        MetricsContext getRootContext()
        Provides access to the root context.
        Returns:
        the root context
      • stop

        void stop()
        Releases resources held by the provider.
        This method must not throw exceptions.
        This method can be called more than once.
      • dump

        void dump​(BiConsumer<String,​Object> sink)
        Dumps all metrics as a key-value pair. This method will be used in legacy monitor command.
        Parameters:
        sink - the receiver of all of the current values.
      • resetAllValues

        void resetAllValues()
        Reset all values. This method is optional and can be noop, depending on the underlying implementation.