public final class TimeDecayingRunningAverage extends java.lang.Object implements RunningAverage, java.lang.Cloneable
Constructor and Description |
---|
TimeDecayingRunningAverage(double defaultValue,
double halfLife,
double min,
double max,
java.io.DataInputStream dis,
TimeSkewDetectorCallback callback) |
TimeDecayingRunningAverage(double defaultValue,
long halfLife,
double min,
double max,
SimpleFieldSet fs,
TimeSkewDetectorCallback callback) |
TimeDecayingRunningAverage(double defaultValue,
long halfLife,
double min,
double max,
TimeSkewDetectorCallback callback) |
TimeDecayingRunningAverage(TimeDecayingRunningAverage a) |
Modifier and Type | Method and Description |
---|---|
TimeDecayingRunningAverage |
clone()
Copy the RunningAverage (create a snapshot).
|
long |
countReports() |
double |
currentValue() |
SimpleFieldSet |
exportFieldSet(boolean shortLived) |
int |
getDataLength() |
long |
lastReportTime() |
void |
report(double d) |
void |
report(long d) |
java.lang.String |
toString() |
double |
valueIfReported(double r)
Get what currentValue() would be if we reported some given value
|
void |
writeDataTo(java.io.DataOutputStream out) |
public TimeDecayingRunningAverage(double defaultValue, long halfLife, double min, double max, TimeSkewDetectorCallback callback)
defaultValue
- halfLife
- min
- max
- callback
- public TimeDecayingRunningAverage(double defaultValue, long halfLife, double min, double max, SimpleFieldSet fs, TimeSkewDetectorCallback callback)
defaultValue
- halfLife
- min
- max
- fs
- callback
- public TimeDecayingRunningAverage(double defaultValue, double halfLife, double min, double max, java.io.DataInputStream dis, TimeSkewDetectorCallback callback) throws java.io.IOException
defaultValue
- halfLife
- min
- max
- dis
- callback
- java.io.IOException
public TimeDecayingRunningAverage(TimeDecayingRunningAverage a)
a
- public final TimeDecayingRunningAverage clone()
RunningAverage
clone
in interface RunningAverage
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public double currentValue()
currentValue
in interface RunningAverage
public void report(double d)
report
in interface RunningAverage
d
- public void report(long d)
report
in interface RunningAverage
d
- public double valueIfReported(double r)
RunningAverage
valueIfReported
in interface RunningAverage
r
- the value to mimic reportingpublic void writeDataTo(java.io.DataOutputStream out) throws java.io.IOException
out
- java.io.IOException
public int getDataLength()
public long countReports()
countReports
in interface RunningAverage
public long lastReportTime()
public SimpleFieldSet exportFieldSet(boolean shortLived)
shortLived
-