public class StopwatchMXBeanImpl extends AbstractSimonMXBeanImpl implements StopwatchMXBean
Stopwatch. It is not created
by default when JMX is activated - it must be created explicitely.
JmxRegisterCallback can be used to automate this.
Class can be subclassed to override default behavior if desired, stopwatch is declared protected for this reason.| Modifier and Type | Field and Description |
|---|---|
protected Stopwatch |
stopwatch
Wrapped
Stopwatch instance - protected for subclasses. |
| Constructor and Description |
|---|
StopwatchMXBeanImpl(Stopwatch stopwatch)
Creates the MX bean for the provided Stopwatch.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getActive()
Returns current number of measured splits (concurrently running).
|
long |
getCounter()
Returns usage count of the stopwatch.
|
long |
getLast()
Returns value of the last added split - whether it was added directly or with stop method.
|
String |
getLastAsString()
Returns value of the last added split as formatted string.
|
long |
getMax()
Returns maximal time split value in nanoseconds.
|
long |
getMaxActive()
Returns peek value of active concurrent splits.
|
long |
getMaxActiveTimestamp()
Returns ms timestamp when the last peek of the active split count occurred.
|
long |
getMaxTimestamp()
Returns ms timestamp when the max value was measured.
|
double |
getMean()
Returns mean value (average) of all measured values.
|
long |
getMin()
Returns minimal time split value in nanoseconds.
|
long |
getMinTimestamp()
Returns ms timestamp when the min value was measured.
|
double |
getStandardDeviation()
Returns standard deviation for all measured values.
|
long |
getTotal()
Returns total sum of all split times in nanoseconds.
|
String |
getType()
Returns Simon type used as a property in the
ObjectName. |
double |
getVariance()
Returns unbiased estimate of the population variance.
|
double |
getVarianceN()
Returns variance value of all measured values (entire population).
|
StopwatchSample |
sample()
Samples Simon values and returns them in a Java Bean derived from Sample interface.
|
StopwatchSample |
sampleIncrement(String key)
Samples increment in Simon values since the previous call of this method with the
same key.
|
protected Simon |
simon()
Returns the wrapped Simon.
|
boolean |
stopIncrementalSampling(String key)
Stops incremental sampling for the key, removing any internal information for the key.
|
getChildrenNames, getFirstUsage, getFirstUsageAsString, getLastUsage, getLastUsageAsString, getName, getNote, getParentName, getState, isEnabled, setNote, setStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChildrenNames, getFirstUsage, getFirstUsageAsString, getLastUsage, getLastUsageAsString, getName, getNote, getParentName, getState, isEnabled, setNote, setStatepublic StopwatchMXBeanImpl(Stopwatch stopwatch)
stopwatch - wrapped Stopwatchpublic long getTotal()
StopwatchMXBeangetTotal in interface StopwatchMXBeanStopwatch.getTotal()public final long getLast()
StopwatchMXBeangetLast in interface StopwatchMXBeanStopwatch.getLast()public final String getLastAsString()
StopwatchMXBeangetLastAsString in interface StopwatchMXBeanpublic long getCounter()
StopwatchMXBeanaddTime and
stop - that means that it's updated every time the next time split is added.getCounter in interface StopwatchMXBeanStopwatch.getCounter()public long getMax()
StopwatchMXBeangetMax in interface StopwatchMXBeanStopwatch.getMax()public long getMin()
StopwatchMXBeangetMin in interface StopwatchMXBeanStopwatch.getMin()public long getMaxTimestamp()
StopwatchMXBeangetMaxTimestamp in interface StopwatchMXBeanStopwatch.getMaxTimestamp()public long getMinTimestamp()
StopwatchMXBeangetMinTimestamp in interface StopwatchMXBeanStopwatch.getMinTimestamp()public long getActive()
StopwatchMXBeangetActive in interface StopwatchMXBeanStopwatch.getActive()public long getMaxActive()
StopwatchMXBeangetMaxActive in interface StopwatchMXBeanStopwatch.getMaxActive()public long getMaxActiveTimestamp()
StopwatchMXBeangetMaxActiveTimestamp in interface StopwatchMXBeanStopwatch.getMaxActiveTimestamp()public double getMean()
StopwatchMXBeangetMean in interface StopwatchMXBeanStopwatch.getMean()public double getStandardDeviation()
StopwatchMXBeangetStandardDeviation in interface StopwatchMXBeanStopwatch.getStandardDeviation()public double getVariance()
StopwatchMXBeangetVariance in interface StopwatchMXBeanStopwatch.getVariance()public double getVarianceN()
StopwatchMXBeangetVarianceN in interface StopwatchMXBeanStopwatch.getVarianceN()public final StopwatchSample sample()
SimonSuperMXBeansample in interface SimonSuperMXBeansample in interface StopwatchMXBeanpublic StopwatchSample sampleIncrement(String key)
SimonSuperMXBeanSimonSuperMXBean.sample(). Any subsequent calls with the key
provide increments.
Clients should use a unique key (GUID, host name, etc.), to avoid interference
with other clients.sampleIncrement in interface SimonSuperMXBeansampleIncrement in interface StopwatchMXBeankey - key used to access incremental sampleSample with value incrementspublic final String getType()
SimonSuperMXBeanObjectName.getType in interface SimonSuperMXBeanpublic boolean stopIncrementalSampling(String key)
SimonSuperMXBeanSimonSuperMXBean.sampleIncrement(String) for the key will be considered the first
call for the key.stopIncrementalSampling in interface SimonSuperMXBeankey - key used to access incremental sampleprotected final Simon simon()
AbstractSimonMXBeanImplsimon in class AbstractSimonMXBeanImplCopyright © 2019. All rights reserved.