Package hudson.model

Class TimeSeries

    • 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].