Class MovingAverageStatistics

java.lang.Object
org.openspaces.admin.internal.alert.bean.util.MovingAverageStatistics

public class MovingAverageStatistics extends Object
A map between a grid components uid to its statistics. The statistics are used to calculate moving average. Created by moran on 3/3/15.
Since:
10.1.0
  • Constructor Details

    • MovingAverageStatistics

      public MovingAverageStatistics(int period)
      Parameters:
      period - number of samples in measurement period
  • Method Details

    • addStatistics

      public void addStatistics(String key, double value)
      statistics values are aggregated per-key.
    • getAverageAndReset

      public double getAverageAndReset(String key)
      get the average and reset the moving-average time-window to return a only after all samples are available again.
      Returns:
      get the average statistics values per key; returns -1 of not all samples are available.
    • getAverage

      public double getAverage(String key)
      Returns:
      get the average statistics values per key; returns -1 of not all samples are available.
    • clear

      public void clear(String key)
      Parameters:
      key - values under this key will be removed
    • clear

      public void clear()
      clear all values mapped
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(String key)
      Returns:
      a toString of the specific key