Package org.quartz.utils.counter.sampled
Class SampledCounterConfig
- java.lang.Object
-
- org.quartz.utils.counter.CounterConfig
-
- org.quartz.utils.counter.sampled.SampledCounterConfig
-
- Direct Known Subclasses:
SampledRateCounterConfig
public class SampledCounterConfig extends CounterConfig
Config for aSampledCounter- Since:
- 1.7
- Author:
- Abhishek Sanoujam
-
-
Constructor Summary
Constructors Constructor Description SampledCounterConfig(int intervalSecs, int historySize, boolean isResetOnSample, long initialValue)Make a new timed counter config (duh)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CountercreateCounter()Creates and returns a Counter based on the initial valueintgetHistorySize()Returns the history sizeintgetIntervalSecs()Returns the interval time (seconds)booleanisResetOnSample()Returns true if counters created from this config will reset on each sample-
Methods inherited from class org.quartz.utils.counter.CounterConfig
getInitialValue
-
-
-
-
Constructor Detail
-
SampledCounterConfig
public SampledCounterConfig(int intervalSecs, int historySize, boolean isResetOnSample, long initialValue)Make a new timed counter config (duh)- Parameters:
intervalSecs- the interval (in seconds) between samplinghistorySize- number of counter samples that will be retained in memoryisResetOnSample- true if the counter should be reset to 0 upon each sample
-
-
Method Detail
-
getHistorySize
public int getHistorySize()
Returns the history size- Returns:
- The history size
-
getIntervalSecs
public int getIntervalSecs()
Returns the interval time (seconds)- Returns:
- Interval of the sampling thread in seconds
-
isResetOnSample
public boolean isResetOnSample()
Returns true if counters created from this config will reset on each sample- Returns:
- true if values are reset to the initial value after each sample
-
createCounter
public Counter createCounter()
Creates and returns a Counter based on the initial value- Overrides:
createCounterin classCounterConfig- Returns:
- The counter created by this config
-
-