Class NoopMetricsRegistry

java.lang.Object
org.opensearch.telemetry.metrics.noop.NoopMetricsRegistry
All Implemented Interfaces:
Closeable, AutoCloseable, MetricsRegistry

@InternalApi public class NoopMetricsRegistry extends Object implements MetricsRegistry
  • Field Details

  • Method Details

    • createCounter

      public Counter createCounter(String name, String description, String unit)
      Description copied from interface: MetricsRegistry
      Creates the counter.
      Specified by:
      createCounter in interface MetricsRegistry
      Parameters:
      name - name of the counter.
      description - any description about the metric.
      unit - unit of the metric.
      Returns:
      counter.
    • createUpDownCounter

      public Counter createUpDownCounter(String name, String description, String unit)
      Description copied from interface: MetricsRegistry
      Creates the upDown counter.
      Specified by:
      createUpDownCounter in interface MetricsRegistry
      Parameters:
      name - name of the upDown counter.
      description - any description about the metric.
      unit - unit of the metric.
      Returns:
      counter.
    • createHistogram

      public Histogram createHistogram(String name, String description, String unit)
      Description copied from interface: MetricsRegistry
      Creates the histogram type of Metric. Implementation framework will take care of the bucketing strategy.
      Specified by:
      createHistogram in interface MetricsRegistry
      Parameters:
      name - name of the histogram.
      description - any description about the metric.
      unit - unit of the metric.
      Returns:
      histogram.
    • createGauge

      public Closeable createGauge(String name, String description, String unit, Supplier<Double> valueProvider, Tags tags)
      Description copied from interface: MetricsRegistry
      Creates the Observable Gauge type of Metric. Where the value provider will be called at a certain frequency to capture the value.
      Specified by:
      createGauge in interface MetricsRegistry
      Parameters:
      name - name of the observable gauge.
      description - any description about the metric.
      unit - unit of the metric.
      valueProvider - value provider.
      tags - attributes/dimensions of the metric.
      Returns:
      closeable to dispose/close the Gauge metric.
    • createGauge

      public Closeable createGauge(String name, String description, String unit, Supplier<TaggedMeasurement> value)
      Description copied from interface: MetricsRegistry
      Creates the Observable Gauge type of Metric. Where the value provider will be called at a certain frequency to capture the value.
      Specified by:
      createGauge in interface MetricsRegistry
      Parameters:
      name - name of the observable gauge.
      description - any description about the metric.
      unit - unit of the metric.
      value - value provider.
      Returns:
      closeable to dispose/close the Gauge metric.
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException