public class SimplePauseDetector extends PauseDetector
All times and time units are in nanoseconds
| Constructor and Description |
|---|
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
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addListener, addListener, notifyListeners, removeListenerpublic 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()
public void setVerbose(boolean verbose)
public void shutdown()
shutdown in class PauseDetectorpublic void stallDetectorThreads(long threadNumberMask,
long stallLength)
throws InterruptedException
threadNumberMask - a mask designating which threads should be stalled.stallLength - stall length, in nanosecond unitsInterruptedException - if internal sleep implementation throws itpublic void skipConsensusTimeTo(long newConsensusTime)
newConsensusTime - time to skip toCopyright © 2015. All rights reserved.