org.qi4j.spi.metrics

## Class DefaultMetric

- java.lang.Object
- - org.qi4j.spi.metrics.DefaultMetric

- All Implemented Interfaces:
    Metric, MetricsCounter, MetricsGauge, MetricsHealthCheck, MetricsHistogram, MetricsMeter, MetricsTimer

      public final class DefaultMetric
      extends Object
      implements MetricsGauge, MetricsCounter, MetricsHistogram, MetricsHealthCheck, MetricsMeter, MetricsTimer

  Default Metric implementing all supported Metrics as a null object.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.qi4j.api.metrics.MetricsHealthCheck

      `MetricsHealthCheck.Result`

    - ### Nested classes/interfaces inherited from interface org.qi4j.api.metrics.MetricsTimer

      `MetricsTimer.Context`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static DefaultMetric` | `NULL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultMetric()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MetricsHealthCheck.Result` | `check()`
    `void` | `decrement()`
    `void` | `decrement(int steps)`
    `void` | `increment()`
    `void` | `increment(int steps)`
    `void` | `mark()`
    `void` | `mark(int numberOfEvents)` Mark the occurrence of a given number of events.
    `MetricsTimer.Context` | `start()` Start the Timer Metrics.
    `void` | `update(long newValue)`
    `Object` | `value()` Returns the metric's current value.

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

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

- - ### Field Detail

    - #### NULL

          public static final DefaultMetric NULL

  - ### Constructor Detail

    - #### DefaultMetric

          public DefaultMetric()

  - ### Method Detail

    - #### increment

          public void increment()

      Specified by:
        `increment` in interface `MetricsCounter`

    - #### increment

          public void increment(int steps)

      Specified by:
        `increment` in interface `MetricsCounter`

    - #### decrement

          public void decrement()

      Specified by:
        `decrement` in interface `MetricsCounter`

    - #### decrement

          public void decrement(int steps)

      Specified by:
        `decrement` in interface `MetricsCounter`

    - #### start

          public MetricsTimer.Context start()

      Description copied from interface: `MetricsTimer`
      Start the Timer Metrics.
      Specified by:
        `start` in interface `MetricsTimer`

    - #### value

          public Object value()

      Description copied from interface: `MetricsGauge`
      Returns the metric's current value.
      Specified by:
        `value` in interface `MetricsGauge`
      Returns:
        the metric's current value

    - #### update

          public void update(long newValue)

      Specified by:
        `update` in interface `MetricsHistogram`

    - #### check

          public MetricsHealthCheck.Result check()
                                          throws Exception

      Specified by:
        `check` in interface `MetricsHealthCheck`
      Throws:
        `Exception`

    - #### mark

          public void mark()

      Specified by:
        `mark` in interface `MetricsMeter`

    - #### mark

          public void mark(int numberOfEvents)

      Description copied from interface: `MetricsMeter`
      Mark the occurrence of a given number of events.
      Specified by:
        `mark` in interface `MetricsMeter`
      Parameters:
        `numberOfEvents` - the number of events