Class SlidingWindowExponentialSmoothingUtilizationAggregator

All Implemented Interfaces:
ISlidingWindowListener

public final class SlidingWindowExponentialSmoothingUtilizationAggregator extends SlidingWindowUtilizationAggregator
This class is a specialized SlidingWindowUtilizationAggregator implementation which calculates the utilization or, (which is more precisely in the scope of this class), the average load) of an active resource based on a sequence of (point in time, state of active resource) or (point in time, utilization of active resource) tuples collected by a SlidingWindow by employing the algorithm that is used in the Linux kernel to compute the average load (Details of this algorithm can be found in this paper, or more succinctly, in this presentation both due to Neil Gunther).
The calculated load is passed to all attached IRecorders in the form of a (point in time, utilization of active resource) tuple each time this implementation processes new window data. Such a point in time is referred to as reporting period and equal to the length of the corresponding SlidingWindow.

Note: The afore-mentioned algorithm is a special case of exponential smoothing with the smoothing factor α derived from the given sampling rate and reporting period.
See Also:
  • Constructor Details

    • SlidingWindowExponentialSmoothingUtilizationAggregator

      public SlidingWindowExponentialSmoothingUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto, javax.measure.Measurable<javax.measure.quantity.Duration> samplingRate, javax.measure.Measurable<javax.measure.quantity.Duration> reportingPeriod)
      Initializes a new instance of the SlidingWindowExponentialSmoothingUtilizationAggregator class with the given arguments.
      Parameters:
      windowDataMetric - The MetricDescription of the measurements to be processed, i.e, which are used to compute the utilization.
      recorderToWriteInto - An IRecorder this instance writes the aggregated window data into. Typically, a recorder that writes into a persistence framework like EDP 2 is passed here.
      samplingRate - An Amount denoting the sampling rate which equals the increment of the associated SlidingWindow.
      For instance, if the given amount is 5s, the average load/utilization is updated every 5 seconds, starting at the window's left bound.
      reportingPeriod - An Amount describing the reporting period which is simply the length of the associated SlidingWindow.
      For instance, if the given amount is 1min, the computed average load/utilization is forwarded every minute to the attached recorders.
      Throws:
      NullPointerException - If any of the arguments is null.
      IllegalArgumentException - If the given metric is not supported by this aggregator, or either of the given amounts is not positive.
  • Method Details

    • processWindowData

      protected org.palladiosimulator.measurementframework.MeasuringValue processWindowData(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> windowData, javax.measure.Measure<Double,javax.measure.quantity.Duration> windowLeftBound, javax.measure.Measure<Double,javax.measure.quantity.Duration> windowLength)
      Description copied from class: SlidingWindowAggregator
      By implementing this method, subclasses (i.e., concrete aggregators) specify how the window data is aggregated/processed and what resulting measurement is passed on to the attached recorder.
      Overrides:
      processWindowData in class SlidingWindowUtilizationAggregator
      Parameters:
      windowData - The window data to be processed.
      windowLeftBound - A Measure denoting the new left bound of the sliding window.
      windowLength - A Measure denoting the length of the sliding window.
      Returns:
      A MeasuringValue that is to be passed on to the attached recorder.
    • getSamplingRate

      public javax.measure.Measurable<javax.measure.quantity.Duration> getSamplingRate()
    • getSmoothingFactor

      public double getSmoothingFactor()