Package org.jppf.utils.stats
Class SingleValueSnapshot
java.lang.Object
org.jppf.utils.stats.AbstractBaseJPPFSnapshot
org.jppf.utils.stats.SingleValueSnapshot
- All Implemented Interfaces:
Serializable,JPPFSnapshot
Instances of this class simply accumulate the values provided via calls to
addValues(double, long).
The min, max, avg and latest values are never computed and thus have a constant value of 0.
This is intended for monitoring snapshots that only handle one value and to avoid excessive overhead during serialization and deserialization.
- Author:
- Laurent Cohen
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jppf.utils.stats.JPPFSnapshot
JPPFSnapshot.LabelBasedFilter, JPPFSnapshot.LabelExcludingFilter, JPPFSnapshot.LabelIncludingFilter -
Constructor Summary
ConstructorsConstructorDescriptionSingleValueSnapshot(String label) Initialize this time snapshot with a specified title. -
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.doubleGet the latest observed value.doublegetMax()Get the peak observed value.doublegetMin()Get the smallest observed value.longGet the count of values added to this snapshot.voidreset()Reset all counters to their initial values.toString()Methods inherited from class org.jppf.utils.stats.AbstractBaseJPPFSnapshot
getLabel, getLastUpdateNanos, getTotal
-
Constructor Details
-
SingleValueSnapshot
Initialize this time snapshot with a specified title.- Parameters:
label- the title for this snapshot.
-
-
Method Details
-
addValues
public 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
Make a copy of this time snapshot object.- Returns:
- a
TimeSnapshotinstance.
-
reset
public void reset()Reset all counters to their initial values. -
getValueCount
public long getValueCount()Description copied from interface:JPPFSnapshotGet the count of values added to this snapshot.- Returns:
- the count of values as a long.
-
getLatest
public double getLatest()Description copied from interface:JPPFSnapshotGet the latest observed value.- Returns:
- the latest value as a double.
-
getMin
public double getMin()Description copied from interface:JPPFSnapshotGet the smallest observed value.- Returns:
- the minimum value as a double.
-
getMax
public double getMax()Description copied from interface:JPPFSnapshotGet the peak observed value.- Returns:
- the peak value double.
-
getAvg
public double getAvg()Description copied from interface:JPPFSnapshotGet the average value.- Returns:
- the average value as a double.
-
toString
-