Package org.jppf.utils.stats
Interface JPPFSnapshot
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractBaseJPPFSnapshot,AbstractJPPFSnapshot,CumulativeSnapshot,NonCumulativeSnapshot,SingleValueSnapshot
Convenience class for collecting time or size statistics.
Instances of this class are thread-safe.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBase class for filters including or excluding snpashots based on a provided set of labels.static classFilter excluding snpashots based on a provided set of labels.static classFilter including snpashots based on a provided set of labels. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValues(double accumulatedValues, long count) Add a set of aggregated values to this snapshot.copy()Make a copy of this time snapshot object.doublegetAvg()Get the average value.getLabel()Get the label for this snapshot.longGet the time elapsed between the creation of this snapshot and its last update, expresseed in nanos.doubleGet the latest observed value.doublegetMax()Get the peak observed value.doublegetMin()Get the smallest observed value.doublegetTotal()Get the total cumulated sum of the values.longGet the count of values added to this snapshot.voidreset()Reset all counters to their initial values.
-
Method Details
-
addValues
void addValues(double accumulatedValues, long count) Add a set of aggregated values to this snapshot.- Parameters:
accumulatedValues- the accumulated sum of the values to add.count- the number of values in the accumalated values.
-
copy
JPPFSnapshot copy()Make a copy of this time snapshot object.- Returns:
- a
TimeSnapshotinstance.
-
reset
void reset()Reset all counters to their initial values. -
getTotal
double getTotal()Get the total cumulated sum of the values.- Returns:
- the cumulated values as a double.
-
getLatest
double getLatest()Get the latest observed value.- Returns:
- the latest value as a double.
-
getMin
double getMin()Get the smallest observed value.- Returns:
- the minimum value as a double.
-
getMax
double getMax()Get the peak observed value.- Returns:
- the peak value double.
-
getAvg
double getAvg()Get the average value.- Returns:
- the average value as a double.
-
getLabel
String getLabel()Get the label for this snapshot.- Returns:
- the label as a string.
-
getValueCount
long getValueCount()Get the count of values added to this snapshot.- Returns:
- the count of values as a long.
-
getLastUpdateNanos
long getLastUpdateNanos()Get the time elapsed between the creation of this snapshot and its last update, expresseed in nanos.- Returns:
- the last update time of this snapshot, as the result of calling
System.nanoTime() - creationTimeNanos.
-