|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.LatencyUtils.PauseDetector org.LatencyUtils.SimplePauseDetector
public class SimplePauseDetector
A Simple PauseDetector that detects pauses using a consensus observation across a configurable number of detection thread. Detection threads can be set to periodically wakeup or continually spin.
All times and time units are in nanoseconds
Constructor Summary | |
---|---|
SimplePauseDetector()
Creates a SimplePauseDetector with a default sleep interval (1 msec), a default pause notification threshold (1 msec), and using the default number of consensus detection threads (3). |
|
SimplePauseDetector(long sleepInterval,
long pauseNotificationThreshold,
int numberOfDetectorThreads)
Creates a SimplePauseDetector |
|
SimplePauseDetector(long sleepInterval,
long pauseNotificationThreshold,
int numberOfDetectorThreads,
boolean verbose)
Creates a SimplePauseDetector |
Method Summary | |
---|---|
void |
setVerbose(boolean verbose)
|
void |
shutdown()
Shut down the pause detector operation and terminate it's threads. |
void |
skipConsensusTimeTo(long newConsensusTime)
A test method that allows the caller to artificially move the consensus observed time forward without causing a pause to be detected as a result of the time skip. |
void |
stallDetectorThreads(long threadNumberMask,
long stallLength)
A test method that allows the caller to artificially stall a requested set of the detector threads for a given amount of time. |
Methods inherited from class org.LatencyUtils.PauseDetector |
---|
addListener, addListener, notifyListeners, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimplePauseDetector(long sleepInterval, long pauseNotificationThreshold, int numberOfDetectorThreads)
sleepInterval
- sleep interval used by detector threadspauseNotificationThreshold
- minimum threshold for reporting detected pausesnumberOfDetectorThreads
- number of consensus detector threads to usepublic SimplePauseDetector(long sleepInterval, long pauseNotificationThreshold, int numberOfDetectorThreads, boolean verbose)
sleepInterval
- sleep interval used by detector threadspauseNotificationThreshold
- minimum threshold for reporting detected pausesnumberOfDetectorThreads
- number of consensus detector threads to useverbose
- provide verbose output when pauses are detectedpublic SimplePauseDetector()
Method Detail |
---|
public void setVerbose(boolean verbose)
public void shutdown()
shutdown
in class PauseDetector
public void stallDetectorThreads(long threadNumberMask, long stallLength) throws java.lang.InterruptedException
threadNumberMask
- a mask designating which threads should be stalled.stallLength
- stall length, in nanosecond units
java.lang.InterruptedException
- if internal sleep implementation throws itpublic void skipConsensusTimeTo(long newConsensusTime)
newConsensusTime
- time to skip to
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |