Package hudson.model
Class TimeSeries
- java.lang.Object
-
- hudson.model.TimeSeries
-
- All Implemented Interfaces:
Serializable
@ExportedBean public final class TimeSeries extends Object implements Serializable
Scalar value that changes over the time (such as load average, Q length, # of executors, etc.)This class computes the exponential moving average from the raw data (to be supplied by
update(float)).- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TimeSeries(float initialValue, float decay, int historySize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]getHistory()Gets the history data of the exponential moving average.floatgetLatest()Gets the most up-to-date data point value.StringtoString()voidupdate(float newData)Pushes a new data point.
-
-
-
Method Detail
-
update
public void update(float newData)
Pushes a new data point.Exponential moving average is calculated, and the
historyis updated. This method needs to be called periodically and regularly, and it represents the raw data stream.
-
getHistory
@Exported public float[] getHistory()
Gets the history data of the exponential moving average. The returned array should be treated as read-only and immutable.- Returns:
- Always non-null, contains at least one entry.
-
getLatest
@Exported public float getLatest()
Gets the most up-to-date data point value.getHistory[0].
-
-