Class MovingAverageStatistics
java.lang.Object
org.openspaces.admin.internal.alert.bean.util.MovingAverageStatistics
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStatistics(String key, double value) statistics values are aggregated per-key.voidclear()clear all values mappedvoiddoublegetAverage(String key) doublegetAverageAndReset(String key) get the average and reset the moving-average time-window to return a only after all samples are available again.toString()
-
Constructor Details
-
MovingAverageStatistics
public MovingAverageStatistics(int period) - Parameters:
period- number of samples in measurement period
-
-
Method Details
-
addStatistics
statistics values are aggregated per-key. -
getAverageAndReset
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
- Returns:
- get the average statistics values per key; returns -1 of not all samples are available.
-
clear
- Parameters:
key- values under this key will be removed
-
clear
public void clear()clear all values mapped -
toString
-
toString
- Returns:
- a toString of the specific key
-