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:
  • Constructor Details

    • TimeSeries

      public TimeSeries(float initialValue, float decay, int historySize)
  • Method Details

    • 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