Top Description Fields Constructors Methods
net.sf.ehcache.util.counter.sampled

public Class SampledCounterConfig

extends CounterConfig
Class Inheritance
Known Direct Subclasses
net.sf.ehcache.util.counter.sampled.SampledRateCounterConfig
Imports
net.sf.ehcache.util.counter.Counter, .CounterConfig

Config for a SampledCounter
Author
Abhishek Sanoujam
Since
1.7

Field Summary

Modifier and TypeField and Description
private final int
private final int
private final boolean

Constructor Summary

AccessConstructor and Description
public
SampledCounterConfig(int
the interval (in seconds) between sampling
intervalSecs
,
int
number of counter samples that will be retained in memory
historySize
,
boolean
true if the counter should be reset to 0 upon each sample
isResetOnSample
,
long
the initial value given to this counter
initialValue
)

Make a new timed counter config (duh)

Method Summary

Modifier and TypeMethod and Description
public Counter
createCounter()

Overrides net.sf.ehcache.util.counter.CounterConfig.createCounter.

Creates and returns a Counter based on the initial value
public int

Returns:

The history size
getHistorySize
()

Returns the history size

public int

Returns:

Interval of the sampling thread in seconds
getIntervalSecs
()

Returns the interval time (seconds)

public boolean

Returns:

true if values are reset to the initial value after each sample
isResetOnSample
()

Returns true if counters created from this config will reset on each sample

Inherited from net.sf.ehcache.util.counter.CounterConfig:
getInitialValue

Field Detail

historySizeback to summary
private final int historySize
intervalSecsback to summary
private final int intervalSecs
isResetback to summary
private final boolean isReset

Constructor Detail

SampledCounterConfigback to summary
public SampledCounterConfig(int intervalSecs, int historySize, boolean isResetOnSample, long initialValue)

Make a new timed counter config (duh)

Parameters
intervalSecs:int

the interval (in seconds) between sampling

historySize:int

number of counter samples that will be retained in memory

isResetOnSample:boolean

true if the counter should be reset to 0 upon each sample

initialValue:long

the initial value given to this counter

Method Detail

createCounterback to summary
public Counter createCounter()

Overrides net.sf.ehcache.util.counter.CounterConfig.createCounter.

Doc from net.sf.ehcache.util.counter.CounterConfig.createCounter.

Creates and returns a Counter based on the initial value

Returns:Counter

The counter created by this config

Annotations
@Override
getHistorySizeback to summary
public int getHistorySize()

Returns the history size

Returns:int

The history size

getIntervalSecsback to summary
public int getIntervalSecs()

Returns the interval time (seconds)

Returns:int

Interval of the sampling thread in seconds

isResetOnSampleback to summary
public boolean isResetOnSample()

Returns true if counters created from this config will reset on each sample

Returns:boolean

true if values are reset to the initial value after each sample