Class CumulativeSnapshot

All Implemented Interfaces:
Serializable, JPPFSnapshot

public class CumulativeSnapshot extends AbstractJPPFSnapshot
In this implementation, getLatest() is computed as the cumulated sum of all values added to the snapshot. If values are only added, and not removed, then it will always return the same value as getTotal().
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • CumulativeSnapshot

      public CumulativeSnapshot(String label)
      Initialize this 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.
    • assignLatestToMax

      public void assignLatestToMax()
      Assign the value of getLatest() to max.
      Specified by:
      assignLatestToMax in class AbstractJPPFSnapshot
    • copy

      public JPPFSnapshot copy()
      Make a copy of this time snapshot object.
      Returns:
      a TimeSnapshot instance.