Package net.i2p.stat
Class RateAverages
- java.lang.Object
-
- net.i2p.stat.RateAverages
-
public class RateAverages extends Object
Storage space for computations of various averages.- Since:
- 0.9.4
- Author:
- zab
-
-
Constructor Summary
Constructors Constructor Description RateAverages()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAverage()
double
getCurrent()
double
getLast()
static RateAverages
getTemp()
long
getTotalEventCount()
double
getTotalValues()
(package private) void
reset()
(package private) void
setAverage(double average)
(package private) void
setCurrent(double current)
(package private) void
setLast(double last)
(package private) void
setTotalEventCount(long totalEventCount)
(package private) void
setTotalValues(double totalValues)
-
-
-
Method Detail
-
getTemp
public static RateAverages getTemp()
- Returns:
- thread-local temp instance.
- Since:
- 0.9.4
-
reset
void reset()
-
getAverage
public double getAverage()
- Returns:
- one of several things: if there are any events (current or last) => weighted average otherwise if the useLifetime parameter to Rate.computeAverages was: true => the lifetime average value false => zero
- Since:
- 0.9.4
-
setAverage
void setAverage(double average)
-
getCurrent
public double getCurrent()
- Returns:
- the current average == current value / current event count
- Since:
- 0.9.4
-
setCurrent
void setCurrent(double current)
-
getLast
public double getLast()
- Returns:
- the last average == last value / last event count
- Since:
- 0.9.4
-
setLast
void setLast(double last)
-
getTotalEventCount
public long getTotalEventCount()
- Returns:
- the total event count == current + last event counts
- Since:
- 0.9.4
-
setTotalEventCount
void setTotalEventCount(long totalEventCount)
-
getTotalValues
public double getTotalValues()
- Returns:
- the total values == current + last values
- Since:
- 0.9.4
-
setTotalValues
void setTotalValues(double totalValues)
-
-