|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jmonit.Probe
org.jmonit.Stopwatch
org.jmonit.features.LocalStopwatch
public class LocalStopwatch
| Field Summary | |
|---|---|
static Factory<Stopwatch> |
FACTORY
|
| Constructor Summary | |
|---|---|
LocalStopwatch()
|
|
| Method Summary | |
|---|---|
void |
cancel()
Cancel monitoring. |
long |
getElapsedTime()
|
Stopwatch |
getFeature()
A feature is identified by the class it exposes to the
monitored application. |
boolean |
isPaused()
|
boolean |
isStarted()
|
boolean |
isStoped()
|
void |
pause()
Temporary stop the Stopwatch. |
void |
resume()
Resume the Stopwatch after a pause. |
void |
setMonitor(Monitor monitor)
Set the monitor this plugin extends. |
void |
setMonitoringEventBus(MonitoringEventBus bus)
Set the event bus used to dispatch monitoring events between the monitor and it's features. |
void |
start()
Start monitoring the process. |
long |
stop()
Stop monitoring the process. |
long |
stop(boolean canceled)
Convenience method to stop or cancel a Stopwatch depending on success of monitored operation |
| Methods inherited from class org.jmonit.Stopwatch |
|---|
finalize, fireMonitoringEvent, nanotime, start |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Factory<Stopwatch> FACTORY
| Constructor Detail |
|---|
public LocalStopwatch()
| Method Detail |
|---|
public void cancel()
StopwatchIn some circumstances you want to monitor time elapsed from early stage of computation, and discover latter if the computed data is relevant. For example, monitoring a messaging system, but beeing interested only by some types of messages. In such case, a Stopwatch can be started early and canceled when the application is able to determine it's relevancy.
In any way, the probe will still report thread concurrency even if canceled.
cancel in class Stopwatchpublic long getElapsedTime()
getElapsedTime in class Stopwatchpublic boolean isPaused()
isPaused in class Stopwatchtrue if the Stopwatch has been pausedpublic boolean isStarted()
isStarted in class Stopwatchtrue if the Stopwatch has been startedpublic boolean isStoped()
isStoped in class Stopwatchtrue if the Stopwatch has been stoppedpublic void pause()
Stopwatch
pause in class Stopwatchpublic void resume()
Stopwatch
resume in class Stopwatchpublic void start()
Stopwatch
start in class Stopwatchpublic long stop()
StopwatchStopwatch.start(Monitor) cannot be re-used after stopped has been called.
stop in class Stopwatchpublic long stop(boolean canceled)
Stopwatch
stop in class Stopwatchpublic Stopwatch getFeature()
class it exposes to the
monitored application.
getFeature in interface Plugin<Stopwatch>Plugin.getFeature()public void setMonitoringEventBus(MonitoringEventBus bus)
setMonitoringEventBus in interface Plugin<Stopwatch>bus - the event busPlugin.setMonitoringEventBus(org.jmonit.events.MonitoringEventBus)public void setMonitor(Monitor monitor)
setMonitor in interface Plugin<Stopwatch>monitor - the extended monitorPlugin.setMonitor(org.jmonit.Monitor)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||