Class StatisticalCharacterizationAggregator

java.lang.Object
org.palladiosimulator.monitorrepository.statisticalcharacterization.StatisticalCharacterizationAggregator
Direct Known Subclasses:
ArithmeticMeanAggregator, GeometricMeanAggregator, HarmonicMeanAggregator, MedianAggregator

public abstract class StatisticalCharacterizationAggregator extends Object
Abstract base class for all implementations of aggregators for StatisticalCharacterizations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    StatisticalCharacterizationAggregator(org.palladiosimulator.metricspec.NumericalBaseMetricDescription expectedDataMetric)
    Initializes a new instance of the StatisticalCharacterizationAggregator class with the given parameter.
  • Method Summary

    Modifier and Type
    Method
    Description
    final org.palladiosimulator.measurementframework.MeasuringValue
    aggregateData(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> data, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> intervalLeftBound, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> intervalRightBound, Optional<org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>> intervalLength)
    Method to be called by clients that wish to aggregate a sequence of data.
    protected abstract javax.measure.Measure<Double,javax.measure.quantity.Quantity>
    calculateStatisticalCharacterizationContinuous(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> dataToAggregate)
    Method to be implemented by each subclass to calculate the statistical characterization of a sequence of measurements with a continuous scope of validity (i.e., to aggregate them).
    This method is invoked within aggregateData(Iterable, Amount, Amount, Optional).
    protected abstract javax.measure.Measure<Double,javax.measure.quantity.Quantity>
    calculateStatisticalCharaterizationDiscrete(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> dataToAggregate)
    Method to be implemented by each subclass to calculate the statistical characterization of a sequence of measurements with a discrete scope of validity (i.e., to aggregate them).
    This method is invoked within aggregateData(Iterable, Amount, Amount, Optional).
    javax.measure.unit.Unit<javax.measure.quantity.Quantity>
    Gets the default unit of the aggregated data.
    org.palladiosimulator.metricspec.NumericalBaseMetricDescription
    Gets the data metric of the measurements this instance is aggregating.
    protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
    Gets the length of the interval that the data to aggregate lie in.
    protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
    obtainCurrentMeasurementValidityLength(org.palladiosimulator.measurementframework.MeasuringValue currentMeasurement, Optional<org.palladiosimulator.measurementframework.MeasuringValue> nextMeasurement)
    Gets how "long" the value of a certain measurement (with a continuous scope of validity) is valid which is the difference between the point in time the next measurement was taken and that of the given measurement (or the left bound of the current interval if the latter is "larger").
    In case no succeeding measurement is present, the right bound of the interval all data lie in is used instead.
    protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Quantity>
    obtainDataFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
    Gets the desired data (i.e., the data that adheres to the expected data metric) from the given measurement.
    protected final double
    obtainDataValueFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
    Gets the numeric value of desired data (i.e., the data that adheres to the expected data metric) from the given measurement.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StatisticalCharacterizationAggregator

      public StatisticalCharacterizationAggregator(org.palladiosimulator.metricspec.NumericalBaseMetricDescription expectedDataMetric)
      Initializes a new instance of the StatisticalCharacterizationAggregator class with the given parameter.
      Parameters:
      expectedDataMetric - The NumericalBaseMetricDescription that describes which kind of measurements are expected to aggregate.
      Throws:
      NullPointerException - In case expectedWindowMetric == null.
  • Method Details

    • getDataMetric

      public org.palladiosimulator.metricspec.NumericalBaseMetricDescription getDataMetric()
      Gets the data metric of the measurements this instance is aggregating.
      Returns:
      The NumericalBaseMetricDescription representing the underlying metric of the data.
      See Also:
    • getDataDefaultUnit

      public javax.measure.unit.Unit<javax.measure.quantity.Quantity> getDataDefaultUnit()
      Gets the default unit of the aggregated data.
      Returns:
      The default unit of the aggregated data, expressed as a Unit object.
      See Also:
    • aggregateData

      public final org.palladiosimulator.measurementframework.MeasuringValue aggregateData(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> data, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> intervalLeftBound, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> intervalRightBound, Optional<org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>> intervalLength)
      Method to be called by clients that wish to aggregate a sequence of data.
      Parameters:
      data - The sequence of data/measurements to be aggregated, expressed as an Iterable of MeasuringValues.
      intervalLeftBound - The left bound of the interval all measurements lie in, expressed in terms of a Duration Amount.
      In the common case this parameter is only used for measurements with a continuous ScopeOfValidity data metric.
      intervalRightBound - The right bound of the interval all measurements lie in, expressed in terms of a Duration Amount.
      In the common case this parameter is only used for measurements with a continuous ScopeOfValidity data metric.
      intervalLength - A potentially empty Optional indicating the interval length.
      If empty, the length is computed from the passed interval bounds.
      Returns:
      A MeasuringValue representing the result of the aggregation.
      Throws:
      NullPointerException - If any of the parameters is null.
      IllegalArgumentException - If any of the given Amounts represents a negative value.
      See Also:
    • getIntervalLength

      protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> getIntervalLength()
      Gets the length of the interval that the data to aggregate lie in.
      Returns:
      An Amount indicating the interval length.
    • obtainDataFromMeasurement

      protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Quantity> obtainDataFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
      Gets the desired data (i.e., the data that adheres to the expected data metric) from the given measurement.
      Parameters:
      measurement - A MeasuringValue containing the data.
      Returns:
      The desired data, expressed in terms of an Amount.
      See Also:
    • obtainDataValueFromMeasurement

      protected final double obtainDataValueFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
      Gets the numeric value of desired data (i.e., the data that adheres to the expected data metric) from the given measurement.
      Parameters:
      measurement - A MeasuringValue containing the data.
      Returns:
      The desired data value, expressed in terms of a double value in the default unit of the corresponding metric.
      See Also:
    • calculateStatisticalCharaterizationDiscrete

      protected abstract javax.measure.Measure<Double,javax.measure.quantity.Quantity> calculateStatisticalCharaterizationDiscrete(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> dataToAggregate)
      Method to be implemented by each subclass to calculate the statistical characterization of a sequence of measurements with a discrete scope of validity (i.e., to aggregate them).
      This method is invoked within aggregateData(Iterable, Amount, Amount, Optional).
      Parameters:
      dataToAggregate - The sequence of data/measurements to be aggregated, expressed as an Iterable of MeasuringValues.
      Returns:
      A Measure representing the result of the aggregation.
      See Also:
    • calculateStatisticalCharacterizationContinuous

      protected abstract javax.measure.Measure<Double,javax.measure.quantity.Quantity> calculateStatisticalCharacterizationContinuous(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> dataToAggregate)
      Method to be implemented by each subclass to calculate the statistical characterization of a sequence of measurements with a continuous scope of validity (i.e., to aggregate them).
      This method is invoked within aggregateData(Iterable, Amount, Amount, Optional).
      Parameters:
      dataToAggregate - The sequence of data/measurements to be aggregated, expressed as an Iterable of MeasuringValues.
      Returns:
      A Measure representing the result of the aggregation.
      See Also:
    • obtainCurrentMeasurementValidityLength

      protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> obtainCurrentMeasurementValidityLength(org.palladiosimulator.measurementframework.MeasuringValue currentMeasurement, Optional<org.palladiosimulator.measurementframework.MeasuringValue> nextMeasurement)
      Gets how "long" the value of a certain measurement (with a continuous scope of validity) is valid which is the difference between the point in time the next measurement was taken and that of the given measurement (or the left bound of the current interval if the latter is "larger").
      In case no succeeding measurement is present, the right bound of the interval all data lie in is used instead.
      Parameters:
      currentMeasurement - The MeasuringValue whose validity "length" is to be determined.
      nextMeasurement - An Optional containing the directly succeeding MeasuringValue, or an empty Optional in case none is at hand.
      Returns:
      The validity "length" of the measurement, expressed in terms of a Duration Amount.
      Throws:
      IllegalStateException - If the ScopeOfValidity of the underlying metric is not ScopeOfValidity.CONTINUOUS.
      See Also: