Interface Meter


  • @ThreadSafe
    public interface Meter
    Provides instruments used to produce metrics.

    Instruments are obtained through builders provided by this interface. Each builder has a default "type" associated with recordings that may be changed.

    A Meter is generally associated with an instrumentation library, e.g. "I monitor apache httpclient".

    • Method Detail

      • counterBuilder

        LongCounterBuilder counterBuilder​(String name)
        Constructs a counter instrument.

        This is used to build both synchronous (in-context) instruments and asynchronous (callback) instruments.

        Parameters:
        name - the name used for the counter.
        Returns:
        a builder for configuring a new Counter instrument. Defaults to recording long values, but may be changed.
      • upDownCounterBuilder

        LongUpDownCounterBuilder upDownCounterBuilder​(String name)
        Constructs an up-down-counter instrument.

        This is used to build both synchronous (in-context) instruments and asynchronous (callback) instruments.

        Parameters:
        name - the name used for the counter.
        Returns:
        a builder for configuring a new Counter synchronous instrument. Defaults to recording long values, but may be changed.
      • histogramBuilder

        DoubleHistogramBuilder histogramBuilder​(String name)
        Constructs a Histogram instrument.
        Parameters:
        name - the name used for the counter.
        Returns:
        a builder for configuring a new Histogram synchronous instrument. Defaults to recording double values, but may be changed.
      • gaugeBuilder

        DoubleGaugeBuilder gaugeBuilder​(String name)
        Constructs an asynchronous gauge.
        Returns:
        a builder used for configuring how to report gauge measurements on demand.