|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.NullSimon
org.javasimon.NullStopwatch
final class NullStopwatch
Null Stopwatch implements Simon returned by the disabled Manager.getStopwatch(String).
It extends NullSimon to satisfy Stopwatch interface.
| Field Summary | |
|---|---|
(package private) static NullStopwatch |
INSTANCE
Internal singleton value of the null Stopwatch. |
private static Split |
NULL_SPLIT
|
| Constructor Summary | |
|---|---|
private |
NullStopwatch()
|
| Method Summary | |
|---|---|
Stopwatch |
addSplit(Split split)
Adds Split to the stopwatch which is useful for aggregation of splits created for other stopwatch. |
Stopwatch |
addTime(long ns)
Adds split time in nanoseconds to total time of the stopwatch. |
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 - wheter it was added directly or with stop method. |
long |
getMax()
Returns maximal time split value in nanoseconds. |
long |
getMaxActive()
Returns peek value of active concurrent splits. |
long |
getMaxActiveTimestamp()
Retruns ms timestamp when the last peek of the active split count occured. |
long |
getMaxTimestamp()
Returns ms timestamp when the max value was measured. |
double |
getMean()
Returns zero. |
long |
getMin()
Returns minimal time split value in nanoseconds. |
long |
getMinTimestamp()
Returns ms timestamp when the min value was measured. |
double |
getStandardDeviation()
Returns zero. |
long |
getTotal()
Returns total sum of all split times in nanoseconds. |
double |
getVariance()
Returns zero. |
double |
getVarianceN()
Returns zero. |
NullStopwatch |
reset()
Resets the Simon values related to the measuring, timestamps and so on - usage timestamps, state, attributes are not affected. |
StopwatchSample |
sample()
Samples Simon values and returns them in a Java Bean derived from Sample interface. |
StopwatchSample |
sampleAndReset()
Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon. |
Split |
start()
Starts the new split for this stopwatch. |
| Methods inherited from class org.javasimon.NullSimon |
|---|
getAttribute, getAttribute, getAttributeNames, getCopyAsSortedMap, getFirstUsage, getChildren, getLastReset, getLastUsage, getName, getNote, getParent, getState, isEnabled, removeAttribute, setAttribute, setNote, setState, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.javasimon.Simon |
|---|
getFirstUsage, getChildren, getLastReset, getLastUsage, getName, getNote, getParent, getState, isEnabled, setNote, setState |
| Methods inherited from interface org.javasimon.HasAttributes |
|---|
getAttribute, getAttribute, getAttributeNames, getCopyAsSortedMap, removeAttribute, setAttribute |
| Field Detail |
|---|
static final NullStopwatch INSTANCE
Stopwatch interface - only its behavior manifests to the client.
private static final Split NULL_SPLIT
| Constructor Detail |
|---|
private NullStopwatch()
| Method Detail |
|---|
public NullStopwatch reset()
SimonSimon.getLastReset(). Reset is perfomed even for disabled Simons.
reset in interface Simonreset in interface Stopwatchreset in class NullSimonpublic long getCounter()
StopwatchaddTime and
stop - that means that it's updated every time the next time split is added.
getCounter in interface Stopwatchpublic long getMin()
Stopwatch
getMin in interface Stopwatchpublic long getMax()
Stopwatch
getMax in interface Stopwatchpublic long getMaxTimestamp()
Stopwatch
getMaxTimestamp in interface Stopwatchpublic long getMinTimestamp()
Stopwatch
getMinTimestamp in interface Stopwatchpublic Stopwatch addTime(long ns)
Stopwatch
addTime in interface Stopwatchns - split time
public Stopwatch addSplit(Split split)
StopwatchSplit to the stopwatch which is useful for aggregation of splits created for other stopwatch.
Split object should be stopped. Main difference is the callback method called as
Callback.onStopwatchAdd(Stopwatch, Split, StopwatchSample) provides split object to the callback.
Usage examples:
Split split = Split.start(); // no stopwatch needed ... someStopwatch.addSplit(split.stop()); // you may omit stop(), if you does not use the split after this point
addSplit in interface Stopwatchsplit - split object (should be stopped)
public Split start()
StopwatchSplit object is collected, no leak occurs. However, active count is increased
and without stopping the split active count stays increased which may render that
information useless.
start in interface StopwatchSplit.stop()public long getTotal()
Stopwatch
getTotal in interface Stopwatchpublic long getLast()
Stopwatch
getLast in interface Stopwatchpublic long getActive()
Stopwatch
getActive in interface Stopwatchpublic long getMaxActive()
Stopwatch
getMaxActive in interface Stopwatchpublic long getMaxActiveTimestamp()
Stopwatch
getMaxActiveTimestamp in interface Stopwatchpublic double getMean()
getMean in interface Stopwatchpublic double getStandardDeviation()
getStandardDeviation in interface Stopwatchpublic double getVariance()
getVariance in interface Stopwatchpublic double getVarianceN()
getVarianceN in interface Stopwatchpublic StopwatchSample sample()
Simon
sample in interface Simonsample in interface Stopwatchsample in class NullSimonpublic StopwatchSample sampleAndReset()
Simon
sampleAndReset in interface SimonsampleAndReset in interface StopwatchsampleAndReset in class NullSimon
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||