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 java.lang.Object
- implements MetricsGauge, MetricsCounter, MetricsHistogram, MetricsHealthCheck, MetricsMeter, MetricsTimer
Default Metric implementing all supported Metrics as a null object.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NULL
public static final DefaultMetric NULL
DefaultMetric
public DefaultMetric()
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 java.lang.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 java.lang.Exception
- Specified by:
check
in interface MetricsHealthCheck
- Throws:
java.lang.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