Class StatisticsObjectList
java.lang.Object
org.openspaces.admin.internal.pu.statistics.StatisticsObjectList
A List of Objects that supports min,max,percentile operations if the Objects implement Comparable
and supports average operation if the Objects implement Number
- Since:
- 9.0.0
- Author:
- itaif
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified object to the listgetLast()getPercentile(double percentile) toString()
-
Constructor Details
-
StatisticsObjectList
public StatisticsObjectList()
-
-
Method Details
-
add
Adds the specified object to the list -
getAverage
- Returns:
- the average values (cast to double) of the object in the list or null if the list is empty
- Throws:
ClassCastException- if any object in the list is not a Number
-
getMinimum
- Returns:
- the minimum (natural order) value object in the list or null if the list is empty.
- Throws:
ClassCastException- if any object in the list is not a Comparable
-
getMaximum
- Returns:
- the maximum (natural order) value object in the list or null if the list is empty.
- Throws:
ClassCastException- if any object in the list is not a Comparable
-
getLast
- Returns:
- the last added sample or null if the list is empty.
-
getPercentile
- Returns:
- the specified percentile (natural order) value object in the list or null if the list is empty.
- Throws:
ClassCastException- if any object in the list is not a ComparableIllegalArgumentException- if percentile is bigger than 100 or less than 0
-
getDeltaValuePerNanoSecond
- Returns:
- the (last-first)/deltaTimeInNanos (cast to double) of the object in the list or null if the are less then 2 values
- Throws:
ClassCastException- if any object in the list is not a Number
-
getDeltaValuePerMilliSecond
- Returns:
- the (last-first)/deltaTimeInMillis (cast to double) of the object in the list or null if the are less then 2 values
- Throws:
ClassCastException- if any object in the list is not a Number
-
getDeltaValuePerSecond
- Returns:
- the (last-first)/deltaTimeInSeconds (cast to double) of the object in the list or null if the are less then 2 values
- Throws:
ClassCastException- if any object in the list is not a Number
-
toString
-