|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutil.Sampler
public abstract class Sampler
Abstract class for simple sampling daemons.
Constructor Summary | |
---|---|
protected |
Sampler(int intervalMillis)
Creates a sampler that executes periodically. |
Method Summary | |
---|---|
protected abstract Statistics |
dumpSamples()
Returns the statistics associated with this sampler. |
void |
run()
|
protected abstract void |
sample()
Takes a sample at the interval. |
protected static Sampler |
start(Sampler sampler)
Starts sampling thread. |
Statistics |
stop()
Stops the sampler and returns the accumulated statistics. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Sampler(int intervalMillis)
intervalMillis
- the expected interval period in milliseconds. If
intervalMillis
is zero, the sampler
will run with an infinite interval (i.e., no-op).Method Detail |
---|
protected abstract void sample()
protected abstract Statistics dumpSamples()
public void run()
run
in interface Runnable
public Statistics stop()
protected static final Sampler start(Sampler sampler)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |