org.javasimon.jmx
Class StopwatchSample

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

public final class StopwatchSample
extends StopwatchSample

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

Example:

 SimonManagerMXBean simon = JMX.newMXBeanProxy(..., new ObjectName("domain:type=Simon"), SimonManagerMXBean.class);
 StopwatchSample = simon.getStopwatchSample("simon.stopwatch");
 

Since:
2.0
Author:
Radovan Sninsky

Constructor Summary
StopwatchSample(StopwatchSample sample)
          Framework constructor for Simon MBean implementation to initialize all properties by sample obtained from Simon.
StopwatchSample(String name, double mean, double stdDev, double var, double varN, String note, long firstUsage, long lastUsage, long lastReset, long total, long counter, long min, long max, long minTimestamp, long maxTimestamp, long active, long maxActive, long maxActiveTimestamp, long last)
          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.
 String getLastAsString()
          Returns the value of the last measured split in ns 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 formatted date.
 String getLastUsageAsString()
          Timestamp of the last usage from the sampled Simon as a formatted string.
 Date getMaxActiveTimestampAsDate()
          Returns ms timestamp when the last peek of the active split count occured as a formatted date.
 String getMaxActiveTimestampAsString()
          Returns ms timestamp when the last peek of the active split count occured as a formatted string.
 String getMaxAsString()
          Returns maximal time split value in nanoseconds 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.
 String getMeanAsString()
          Returns mean value (average) of all measured values as a formatted string (ns).
 String getMinAsString()
          Returns minimal time split value in nanoseconds 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.
 String getTotalAsString()
          Returns the total sum of all split times in nanoseconds as a formatted string.
 
Methods inherited from class org.javasimon.StopwatchSample
getActive, getCounter, getLast, getMax, getMaxActive, getMaxActiveTimestamp, getMaxTimestamp, getMean, getMin, getMinTimestamp, getStandardDeviation, getTotal, getVariance, getVarianceN, setActive, setCounter, setLast, setMax, setMaxActive, setMaxActiveTimestamp, setMaxTimestamp, setMean, setMin, setMinTimestamp, setStandardDeviation, setTotal, setVariance, setVarianceN, stopwatchToString, 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

StopwatchSample

@ConstructorProperties(value={"name","mean","standardDeviation","variance","varianceN","note","firstUsage","lastUsage","lastReset","total","counter","min","max","minTimestamp","maxTimestamp","active","maxActive","maxActiveTimestamp","last"})
public StopwatchSample(String name,
                                                  double mean,
                                                  double stdDev,
                                                  double var,
                                                  double varN,
                                                  String note,
                                                  long firstUsage,
                                                  long lastUsage,
                                                  long lastReset,
                                                  long total,
                                                  long counter,
                                                  long min,
                                                  long max,
                                                  long minTimestamp,
                                                  long maxTimestamp,
                                                  long active,
                                                  long maxActive,
                                                  long maxActiveTimestamp,
                                                  long last)
JMX constructor. Constructor used by JMX client code to initialize all properties of object from composite data object.

Parameters:
name - Simon's name
mean - mean value (provided optionally)
stdDev - standard deviation (provided optionally)
var - variance (provided optionally)
varN - variance N (provided optionally)
firstUsage - first usage ms timestamp
lastUsage - last usage ms timestamp
lastReset - last reset ms timestamp
total - sum of all measured times
note - note (provided optionally)
counter - count of measures
min - minimal measured time
max - maximal measured time
minTimestamp - ms timestamp when minimal time was measured
maxTimestamp - ms timestamp when maximal time was measured
active - count of actual running measures
maxActive - maximum paralel measures
maxActiveTimestamp - ms timestamp time when maximum paralel measures happend
last - last split value in ns

StopwatchSample

public StopwatchSample(StopwatchSample sample)
Framework constructor for Simon MBean implementation to initialize all properties by sample obtained from Simon.

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

getLastAsString

public final String getLastAsString()
Returns the value of the last measured split in ns as a formatted string.

Returns:
last measured split in ns as string

getTotalAsString

public final String getTotalAsString()
Returns the total sum of all split times in nanoseconds as a formatted string.

Returns:
total time of the stopwatch in nanoseconds as string

getMinAsString

public final String getMinAsString()
Returns minimal time split value in nanoseconds as a formatted string.

Returns:
minimal time split in nanoseconds as string

getMaxAsString

public final String getMaxAsString()
Returns maximal time split value in nanoseconds as a formatted string.

Returns:
maximal time split in nanoseconds as string

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

getMaxActiveTimestampAsString

public final String getMaxActiveTimestampAsString()
Returns ms timestamp when the last peek of the active split count occured as a formatted string.

Returns:
ms timestamp of the last peek of the active split count as string

getMaxActiveTimestampAsDate

public final Date getMaxActiveTimestampAsDate()
Returns ms timestamp when the last peek of the active split count occured as a formatted date.

Returns:
ms timestamp of the last peek of the active split count as date

getMeanAsString

public final String getMeanAsString()
Returns mean value (average) of all measured values as a formatted string (ns).

Returns:
mean value as string

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 formatted date.

Returns:
Simon's last usage timestamp as string

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


Copyright © 2013. All Rights Reserved.