SampledCounter
| Modifier and Type | Field and Description |
|---|---|
| protected final CircularLossyQueue | history
The history of this counter |
| private final long | |
| private static final int | |
| protected final boolean | resetOnSample
Should the counter reset on each sample? |
| private final TimerTask |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SampledCounterImpl(long
sampling interval in seconds intervalInSeconds, int size of history sample historySize, boolean true to reset value on sample resetOnSample, long initial value initValue, boolean true to record smaple immediately sampleNow)Constructor accepting raw config values. |
| Modifier and Type | Method and Description |
|---|---|
| public TimeStampedCounterValue[] | getAllSampleValues()
Implements net. |
| public long | getAndReset()
Implements net. |
| public long | Returns: the sampling thread interval in millisReturns the sampling thread interval in millis |
| public TimeStampedCounterValue | getMostRecentSample()
Implements net. |
| public TimerTask | Returns: the timer task for this sampled counterReturns the timer task for this sampled counter |
| pack-priv void | |
| public void | shutdown()
Implements net. |
| history | back to summary |
|---|---|
| protected final CircularLossyQueue<TimeStampedCounterValue> history The history of this counter | |
| intervalMillis | back to summary |
|---|---|
| private final long intervalMillis | |
| MILLIS_PER_SEC | back to summary |
|---|---|
| private static final int MILLIS_PER_SEC | |
| resetOnSample | back to summary |
|---|---|
| protected final boolean resetOnSample Should the counter reset on each sample? | |
| samplerTask | back to summary |
|---|---|
| private final TimerTask samplerTask | |
| SampledCounterImpl | back to summary |
|---|---|
| public SampledCounterImpl(SampledCounterConfig config) todo GL how many threads is this creating?
Constructor accepting a | |
| SampledCounterImpl | back to summary |
|---|---|
| public SampledCounterImpl(long intervalInSeconds, int historySize, boolean resetOnSample, long initValue, boolean sampleNow) Constructor accepting raw config values.
| |
| getAllSampleValues | back to summary |
|---|---|
| public TimeStampedCounterValue[] getAllSampleValues() Implements net. Doc from net. Returns all samples in history
| |
| getAndReset | back to summary |
|---|---|
| public long getAndReset() Implements net. Doc from net. Returns the current value of the counter and resets it to 0
| |
| getIntervalMillis | back to summary |
|---|---|
| public long getIntervalMillis() Returns the sampling thread interval in millis
| |
| getMostRecentSample | back to summary |
|---|---|
| public TimeStampedCounterValue getMostRecentSample() Implements net. Doc from net. Returns the most recent sampled value
| |
| getTimerTask | back to summary |
|---|---|
| public TimerTask getTimerTask() Returns the timer task for this sampled counter
| |
| recordSample | back to summary |
|---|---|
| pack-priv void recordSample() | |
| shutdown | back to summary |
|---|---|
| public void shutdown() Implements net. Doc from net. Shutdown this counter | |