Class AbstractSharedTimerSet
- java.lang.Object
-
- com.google.apphosting.runtime.timer.AbstractSharedTimerSet
-
- All Implemented Interfaces:
TimerSet
- Direct Known Subclasses:
JmxGcTimerSet,JmxHotspotTimerSet
public abstract class AbstractSharedTimerSet extends Object implements TimerSet
AbstractSharedTimerSettracks a single counter that is shared by all of theTimerinstances that are part of the set.Each
Timerreturned bycreateTimer()becomes part of the set that created it, and starting or stopping that timer will increment or decrement the rate at which all other active timers are advancing.
-
-
Constructor Summary
Constructors Constructor Description AbstractSharedTimerSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TimercreateTimer()intgetActiveCount()Returns the number ofTimerinstances in this set that are currently active (i.e.protected abstract longgetCurrentShared()Returns the current value of a counter that is shared by all timers created by callingcreateTimer()on this instance.protected abstract StringgetTitle()Implementations should provide a short, readable string to be included in thetoString()output of the timers that they create (e.g.
-
-
-
Method Detail
-
createTimer
public Timer createTimer()
Description copied from interface:TimerSet- Specified by:
createTimerin interfaceTimerSet
-
getActiveCount
public int getActiveCount()
Description copied from interface:TimerSetReturns the number ofTimerinstances in this set that are currently active (i.e.Timer.start()has been called since the lastTimer.stop()call.- Specified by:
getActiveCountin interfaceTimerSet
-
getCurrentShared
protected abstract long getCurrentShared()
Returns the current value of a counter that is shared by all timers created by callingcreateTimer()on this instance. The rate of change of this counter will be evenly divided among startedTimerinstances.
-
getTitle
protected abstract String getTitle()
Implementations should provide a short, readable string to be included in thetoString()output of the timers that they create (e.g. "hotspot").
-
-