org.javasimon.jmx
Interface CounterMXBean

All Superinterfaces:
SimonSuperMXBean
All Known Implementing Classes:
CounterMXBeanImpl

public interface CounterMXBean
extends SimonSuperMXBean

Interface for MX Bean representing a particular Counter. It is not created by default when JMX is activated - it must be created explicitely. JmxRegisterCallback can be used to automate this.

Author:
Richard "Virgo" Richter

Method Summary
 void decrease()
          Decrements the counter by one.
 void decrease(long dec)
          Increments the counter by the specified value.
 long getCounter()
          Returns the current value of the counter.
 long getDecrementSum()
          Returns the sum of all decremented values (as a positive number).
 long getIncrementSum()
          Returns the sum of all incremented values.
 long getMax()
          Returns maximal value of counter.
 long getMaxTimestamp()
          Returns ms timestamp when the max value was reached.
 long getMin()
          Returns minimal value of counter.
 long getMinTimestamp()
          Returns ms timestamp when the min value was reached.
 void increase()
          Increments the counter by one.
 void increase(long inc)
          Increments the counter by the specified value.
 CounterSample sample()
          Samples Simon values and returns them in a Java Bean derived from Sample interface.
 CounterSample sampleAndReset()
          Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon.
 void set(long val)
          Sets the value of the counter to specified value.
 
Methods inherited from interface org.javasimon.jmx.SimonSuperMXBean
getFirstUsage, getFirstUsageAsString, getChildrenNames, getLastUsage, getLastUsageAsString, getName, getNote, getParentName, getState, getType, isEnabled, reset, setNote, setState
 

Method Detail

increase

void increase()
Increments the counter by one.

See Also:
Counter.increase()

decrease

void decrease()
Decrements the counter by one.

See Also:
Counter.decrease()

increase

void increase(long inc)
Increments the counter by the specified value.

Parameters:
inc - added value
See Also:
Counter.increase(long)

decrease

void decrease(long dec)
Increments the counter by the specified value.

Parameters:
dec - subtracted value
See Also:
Counter.decrease(long)

getCounter

long getCounter()
Returns the current value of the counter.

Returns:
counter value
Since:
3.3
See Also:
Counter.getCounter()

getMin

long getMin()
Returns minimal value of counter.

Returns:
maximal reached value
Since:
3.3
See Also:
Counter.getMin()

getMinTimestamp

long getMinTimestamp()
Returns ms timestamp when the min value was reached.

Returns:
ms timestamp of the min value decremented
Since:
3.3
See Also:
Counter.getMinTimestamp()

getMax

long getMax()
Returns maximal value of counter.

Returns:
maximal reached value
Since:
3.3
See Also:
Counter.getMax()

getMaxTimestamp

long getMaxTimestamp()
Returns ms timestamp when the max value was reached.

Returns:
ms timestamp of the max value incremented
Since:
3.3
See Also:
Counter.getMaxTimestamp()

set

void set(long val)
Sets the value of the counter to specified value.

Parameters:
val - new counter value
See Also:
Counter.set(long)

getIncrementSum

long getIncrementSum()
Returns the sum of all incremented values. If incremented value was negative, sum is lowered by this value.

Returns:
sum of all incremented values
Since:
3.3
See Also:
Counter.getIncrementSum()

getDecrementSum

long getDecrementSum()
Returns the sum of all decremented values (as a positive number). If decremented value was negative, sum is lowered by this value.

Returns:
sum of all decremented values
Since:
3.3
See Also:
Counter.getDecrementSum()

sample

CounterSample sample()
Description copied from interface: SimonSuperMXBean
Samples Simon values and returns them in a Java Bean derived from Sample interface.

Specified by:
sample in interface SimonSuperMXBean
Returns:
sample containing all Simon values

sampleAndReset

CounterSample sampleAndReset()
Description copied from interface: SimonSuperMXBean
Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon. Operation is synchronized to assure atomicity.

Specified by:
sampleAndReset in interface SimonSuperMXBean
Returns:
sample containing all Simon values


Copyright © 2013. All Rights Reserved.