org.javasimon.jmx
Class CounterSample

java.lang.Object
  extended by org.javasimon.Sample
      extended by org.javasimon.CounterSample
          extended by org.javasimon.jmx.CounterSample

public final class CounterSample
extends CounterSample

Value object for retrieving data from Counter Simon. Basically, it's CounterSample with added JMX capabilities to be return as object via MXBean method.

Example:

 SimonManagerMXBean simon = JMX.newMXBeanProxy(..., new ObjectName("domain:type=Simon"), SimonManagerMXBean.class);
 CounterSample = simon.getCounterSample("simon.counter");
 

Since:
2.0
Author:
Radovan Sninsky

Constructor Summary
CounterSample(CounterSample sample)
          Internall, framework constructor for Simon MBean implementation to initialize all properties by sample obtained from Simon.
CounterSample(String name, String note, long firstUsage, long lastUsage, long lastReset, long counter, long min, long max, long minTimestamp, long maxTimestamp, long incSum, long decSum)
          JMX constructor.
 
Method Summary
 Date getFirstUsageAsDate()
          Timestamp of the first usage from the sampled Simon as a formatted date.
 String getFirstUsageAsString()
          Timestamp of the first usage from the sampled Simon as a formatted string.
 Date getLastResetAsDate()
          Timestamp of the last reset from the sampled Simon as a formatted date.
 String getLastResetAsString()
          Timestamp of the last reset from the sampled Simon as a formatted string.
 Date getLastUsageAsDate()
          Timestamp of the last usage from the sampled Simon as a date.
 String getLastUsageAsString()
          Timestamp of the last usage from the sampled Simon as a formatted string.
 Date getMaxTimestampAsDate()
          Returns ms timestamp when the max value was measured as a formatted date.
 String getMaxTimestampAsString()
          Returns ms timestamp when the max value was measured as a formatted string.
 Date getMinTimestampAsDate()
          Returns ms timestamp when the min value was measured as a formatted date.
 String getMinTimestampAsString()
          Returns ms timestamp when the min value was measured as a formatted string.
 
Methods inherited from class org.javasimon.CounterSample
counterToString, getCounter, getDecrementSum, getIncrementSum, getMax, getMaxTimestamp, getMin, getMinTimestamp, getTotalAsString, setCounter, setDecrementSum, setIncrementSum, setMax, setMaxTimestamp, setMin, setMinTimestamp, toString
 
Methods inherited from class org.javasimon.Sample
getFirstUsage, getLastReset, getLastUsage, getName, getNote, setFirstUsage, setLastReset, setLastUsage, setName, setNote, simonToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CounterSample

@ConstructorProperties(value={"name","note","firstUsage","lastUsage","lastReset","counter","min","max","minTimestamp","maxTimestamp","incrementSum","decrementSum"})
public CounterSample(String name,
                                                String note,
                                                long firstUsage,
                                                long lastUsage,
                                                long lastReset,
                                                long counter,
                                                long min,
                                                long max,
                                                long minTimestamp,
                                                long maxTimestamp,
                                                long incSum,
                                                long decSum)
JMX constructor. Constructor used by JMX client code to initialize all properties of object from composite data object.

Parameters:
name - Simon's name
note - note (provided optionally)
firstUsage - first usage ms timestamp
lastUsage - last usage ms timestamp
lastReset - last reset ms timestamp
counter - actual counter value
min - minimal counter value
max - maximal counter value
minTimestamp - time when counter reached minimal value
maxTimestamp - time when counter reached maximal value
incSum - sum of all increments
decSum - sum of all decrements

CounterSample

CounterSample(CounterSample sample)
Internall, framework constructor for Simon MBean implementation to initialize all properties by sample obtained from Simon.

Parameters:
sample - sample object obtained from Counter Simon
Method Detail

getFirstUsageAsString

public String getFirstUsageAsString()
Timestamp of the first usage from the sampled Simon as a formatted string.

Returns:
Simon's first usage timestamp as string

getFirstUsageAsDate

public Date getFirstUsageAsDate()
Timestamp of the first usage from the sampled Simon as a formatted date.

Returns:
Simon's first usage timestamp as date

getLastUsageAsString

public String getLastUsageAsString()
Timestamp of the last usage from the sampled Simon as a formatted string.

Returns:
Simon's last usage timestamp as string

getLastUsageAsDate

public Date getLastUsageAsDate()
Timestamp of the last usage from the sampled Simon as a date.

Returns:
Simon's last usage timestamp as date

getLastResetAsString

public String getLastResetAsString()
Timestamp of the last reset from the sampled Simon as a formatted string.

Returns:
Simon's last reset timestamp as string

getLastResetAsDate

public Date getLastResetAsDate()
Timestamp of the last reset from the sampled Simon as a formatted date.

Returns:
Simon's last reset timestamp as date

getMinTimestampAsString

public final String getMinTimestampAsString()
Returns ms timestamp when the min value was measured as a formatted string.

Returns:
ms timestamp of the min value measurement as string

getMinTimestampAsDate

public final Date getMinTimestampAsDate()
Returns ms timestamp when the min value was measured as a formatted date.

Returns:
ms timestamp of the min value measurement as date

getMaxTimestampAsString

public final String getMaxTimestampAsString()
Returns ms timestamp when the max value was measured as a formatted string.

Returns:
ms timestamp of the max value measurement as string

getMaxTimestampAsDate

public final Date getMaxTimestampAsDate()
Returns ms timestamp when the max value was measured as a formatted date.

Returns:
ms timestamp of the max value measurement as date


Copyright © 2013. All Rights Reserved.