Interface: Metric

Metric

Interface for Metric types.

Implementations


  • Counter, things that increment or decrement.

  • Gauge, values that can be read instantly via a supplied call back.

  • Histogram, keeps a reservoir of statistically relevant values to explore their distribution.

  • Meter, things that are measured as events / interval.

  • NoOpMeter, an empty impl of meter, useful for supplying to a Timer, when you only care about the Histogram.

  • SettableGauge, just like a Gauge but its value is set directly rather than supplied by a callback.

  • CachedGauge, A Cached Gauge takes a function that returns a promise that resolves a value that should be cached and updated on a given interval.

  • Timer, timers are a combination of Meters and Histograms. They measure the rate as well as distribution of scalar events.

  • Source:

    Methods


    getType()

    The type of the Metric Impl. MetricTypes.

    Source:
    Returns:

    The type of the Metric Impl.

    Type
    string

    toJSON()

    Please note that dispite its name, this method can return raw numbers on
    certain implementations such as counters and gauges.

    Source:
    Returns:

    Returns the data from the Metric

    Type
    any