org.qi4j.spi.metrics
Class DefaultMetric

java.lang.Object
  extended by 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.


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
static DefaultMetric NULL
           
 
Constructor Summary
DefaultMetric()
           
 
Method Summary
 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)
           
 java.lang.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 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