hudson.model
Class TimeSeries

java.lang.Object
  extended by 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
TimeSeries(float initialValue, float decay, int historySize)
           
 
Method Summary
 float[] getHistory()
          Gets the history data of the exponential moving average.
 float getLatest()
          Gets the most up-to-date data point value.
 String toString()
           
 void update(float newData)
          Pushes a new data point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeSeries

public TimeSeries(float initialValue,
                  float decay,
                  int historySize)
Method Detail

update

public void update(float newData)
Pushes a new data point.

Exponential moving average is calculated, and the history is 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].


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2013. All Rights Reserved.