public class LongAvgRateStat extends StatWithValueType<Long>
definition| Constructor and Description |
|---|
LongAvgRateStat(StatGroup group,
StatDefinition definition,
long periodMillis,
TimeUnit reportTimeUnit)
Creates an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(long value,
long time)
Adds a new value to the average.
|
void |
add(Stat<Long> other)
Add the value of "other" to this stat.
|
void |
clear()
Resets the statistic to its initial state.
|
LongAvgRateStat |
computeInterval(Stat<Long> base)
Create a stat that includes the newest entries from this stat and the
base stat.
|
LongAvgRateStat |
copy()
Returns a copy of this statistic.
|
Long |
get()
Returns the value of the statistic.
|
protected String |
getFormattedValue()
Returns the value of the statistic as a formatted string.
|
Class<Long> |
getValueType()
Returns the type of the value returned by the
BaseStat.get() method. |
boolean |
isNotSet()
Returns whether the statistic is in its initial state.
|
void |
negate()
Do nothing for this non-additive stat.
|
void |
set(Long newValue)
Set the stat value.
|
getForTypecopyAndAdd, copyAndClear, getDefinition, toString, toStringVerbosepublic LongAvgRateStat(StatGroup group, StatDefinition definition, long periodMillis, TimeUnit reportTimeUnit)
group - the statistics groupdefinition - the statistics definitionperiodMillis - the averaging period in millisecondsreportTimeUnit - the time unit for reporting the ratepublic void add(long value,
long time)
value - the new valuetime - the current timepublic Class<Long> getValueType()
StatWithValueTypeBaseStat.get() method.getValueType in class StatWithValueType<Long>public void clear()
BaseStatpublic LongAvgRateStat copy()
BaseStatprotected String getFormattedValue()
BaseStatgetFormattedValue in class BaseStat<Long>public boolean isNotSet()
BaseStatpublic void set(Long newValue)
Statset in class Stat<Long>UnsupportedOperationException - alwayspublic void add(Stat<Long> other)
Statadd in class Stat<Long>UnsupportedOperationException - alwayspublic LongAvgRateStat computeInterval(Stat<Long> base)
computeInterval in class Stat<Long>Copyright © 2024. All rights reserved.