public class StopwatchSample extends Sample
Stopwatch
Simon. Whenever it is important to get more values
in a synchronous manner, Stopwatch.sample()
(or Stopwatch.sampleIncrement(Object)
should be used to obtain this Java Bean object.Constructor and Description |
---|
StopwatchSample() |
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 the value of the last measured split in ns.
|
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 unbiased estimate of standard deviation.
|
long |
getTotal()
Returns the total sum of all split times in nanoseconds.
|
double |
getVariance()
Returns unbiased estimate of the population variance.
|
double |
getVarianceN()
Returns variance value of all measured values (entire population).
|
void |
setActive(long active)
Sets the current number of measured splits (concurrently running).
|
void |
setCounter(long counter)
Sets the usage count of the stopwatch.
|
void |
setLast(long last)
Sets the value of the last measured split in ns.
|
void |
setMax(long max)
Sets the maximal time split value in nanoseconds.
|
void |
setMaxActive(long maxActive)
Sets the peek value of active concurrent splits.
|
void |
setMaxActiveTimestamp(long maxActiveTimestamp)
Sets the ms timestamp when the last peek of the active split count occurred.
|
void |
setMaxTimestamp(long maxTimestamp)
Sets the ms timestamp when the max value was measured.
|
void |
setMean(double mean)
Sets the mean value (average) of all measured values.
|
void |
setMin(long min)
Sets the minimal time split value in nanoseconds.
|
void |
setMinTimestamp(long minTimestamp)
Sets the ms timestamp when the min value was measured.
|
void |
setStandardDeviation(double standardDeviation)
Sets unbiased estimate of standard deviation.
|
void |
setTotal(long total)
Sets the total sum of all split times in nanoseconds.
|
void |
setVariance(double variance)
Sets the unbiased estimate of the population variance.
|
void |
setVarianceN(double varianceN)
Sets the variance value of all measured values (entire population).
|
String |
simonToString()
Equivalent to
StopwatchImpl.toString() without state. |
String |
toString()
Returns readable representation of object.
|
getFirstUsage, getLastUsage, getName, getNote, setFirstUsage, setLastUsage, setName, setNote
public StopwatchSample()
public final long getTotal()
public final void setTotal(long total)
total
- total time of the stopwatch in nanosecondspublic final long getCounter()
addTime
and
stop
- that means that it's updated every time the next time split is added.public final void setCounter(long counter)
counter
- count of time splitspublic final long getMin()
public final void setMin(long min)
min
- minimal time split in nanosecondspublic final long getMax()
public final void setMax(long max)
max
- maximal time split in nanosecondspublic final long getMinTimestamp()
public final void setMinTimestamp(long minTimestamp)
minTimestamp
- ms timestamp of the min value measurementpublic final long getMaxTimestamp()
public final void setMaxTimestamp(long maxTimestamp)
maxTimestamp
- ms timestamp of the max value measurementpublic final long getActive()
public final void setActive(long active)
active
- current number of active splitspublic final long getMaxActive()
public final void setMaxActive(long maxActive)
maxActive
- maximum reached value of active splitspublic final long getMaxActiveTimestamp()
public final void setMaxActiveTimestamp(long maxActiveTimestamp)
maxActiveTimestamp
- ms timestamp of the last peek of the active split countpublic final long getLast()
public final void setLast(long last)
last
- last measured split in nspublic final double getMean()
public final void setMean(double mean)
mean
- mean valuepublic final double getStandardDeviation()
public final void setStandardDeviation(double standardDeviation)
standardDeviation
- unbiased estimate of standard deviationpublic final double getVariance()
public final void setVariance(double variance)
variance
- unbiased estimated variancepublic final double getVarianceN()
public final void setVarianceN(double varianceN)
varianceN
- entire population variancepublic String simonToString()
StopwatchImpl.toString()
without state.simonToString
in class Sample
Copyright © 2019. All rights reserved.