Class AggregatedValueObject

java.lang.Object
org.glassfish.jersey.server.internal.monitoring.AggregatedValueObject

class AggregatedValueObject extends Object
Aggregated value object stores aggregated measurements for provided set of data. The purpose of aggregation is to avoid high memory and processor time requirements for the calculation of statistics.
  • Field Details

    • max

      private final long max
    • min

      private final long min
    • mean

      private final double mean
    • count

      private final long count
  • Constructor Details

    • AggregatedValueObject

      private AggregatedValueObject(long max, long min, double mean, long count)
  • Method Details

    • createFromValues

      public static AggregatedValueObject createFromValues(Collection<Long> values)
      Creates aggregated value object for monitoring statistics based on the provided values. During the construction, the values collection must not be modified.
      Parameters:
      values - The collection to create the aggregated statistics from.
      Returns:
      Aggregated value object for provided arguments.
    • createFromMultiValues

      public static AggregatedValueObject createFromMultiValues(Collection<? extends Collection<Long>> values)
      Creates aggregated value object for monitoring statistics based on the provided collection of values. During the construction, the values collection must not be modified.
      Parameters:
      values - The collection to create the aggregated statistics from.
      Returns:
      Aggregated value object for provided arguments.
    • getMax

      public long getMax()
      Returns:
      The maximum value of the aggregated data
    • getMin

      public long getMin()
      Returns:
      The minimum value of the aggregated data
    • getMean

      public double getMean()
      Returns:
      The mean of the aggregated data
    • getCount

      public long getCount()
      Returns:
      The total number of the values this aggregated data provide information about