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.IOExceptionpublic TimeDecayingRunningAverage(TimeDecayingRunningAverage a)
a - public final TimeDecayingRunningAverage clone()
RunningAverageclone in interface RunningAverageclone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic double currentValue()
currentValue in interface RunningAveragepublic void report(double d)
report in interface RunningAveraged - public void report(long d)
report in interface RunningAveraged - public double valueIfReported(double r)
RunningAveragevalueIfReported in interface RunningAverager - the value to mimic reportingpublic void writeDataTo(java.io.DataOutputStream out)
throws java.io.IOException
out - java.io.IOExceptionpublic int getDataLength()
public long countReports()
countReports in interface RunningAveragepublic long lastReportTime()
public SimpleFieldSet exportFieldSet(boolean shortLived)
shortLived -