Class SlidingWindowUtilizationAggregator

java.lang.Object
org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowAggregator
org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowUtilizationAggregator
All Implemented Interfaces:
ISlidingWindowListener
Direct Known Subclasses:
SlidingWindowExponentialSmoothingUtilizationAggregator

public class SlidingWindowUtilizationAggregator extends SlidingWindowAggregator
This class is a SlidingWindowAggregator implementation which calculates the utilization 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.
The calculated utilization is passed to the attached IRecorder in the form of a (point in time, utilization of active resource) tuple each time this implementation processes new window data.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SlidingWindowUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)
    Initializes a new instance of the SlidingWindowUtilizationAggregator class with the given parameter.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Collection<org.palladiosimulator.metricspec.MetricDescription>
    Gets all data metrics that can be processed by instances of this class.
    org.palladiosimulator.metricspec.MetricDescription
    Returns the MetricDescription all window data must adhere to in order to be processed by this aggregator.
    protected static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
    obtainPointInTimeAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
    Gets the point in time the given measurement was taken.
    protected org.jscience.physics.amount.Amount<javax.measure.quantity.Dimensionless>
    obtainStateAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
    Gets the state of active resource measurement captured by the given measuring value.
    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)
    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.

    Methods inherited from class org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowAggregator

    addRecorder, onSlidingWindowFull

    Methods inherited from class java.lang.Object

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

    • ZERO_DURATION

      protected static final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> ZERO_DURATION
  • Constructor Details

    • SlidingWindowUtilizationAggregator

      public SlidingWindowUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)
      Initializes a new instance of the SlidingWindowUtilizationAggregator class with the given parameter.
      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.
      Throws:
      NullPointerException - If either argument is null.
      IllegalArgumentException - If the given metric is not supported by this aggregator.
  • 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.
      Specified by:
      processWindowData in class SlidingWindowAggregator
      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.
    • obtainPointInTimeAmountFromMeasurement

      protected static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> obtainPointInTimeAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
      Gets the point in time the given measurement was taken.
      Parameters:
      measurement - A (not null) MeasuringValue instance containing a point in time measure.
      Returns:
      An Amount that represents the point in time the given measurement was taken.
    • obtainStateAmountFromMeasurement

      protected org.jscience.physics.amount.Amount<javax.measure.quantity.Dimensionless> obtainStateAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
      Gets the state of active resource measurement captured by the given measuring value.
      Parameters:
      measurement - A (not null) MeasuringValue instance containing a dimensionless state of active resource measurement, or, in case of multi-core utilization, a utilization of active resource measurement.
      Returns:
      A Dimensionless Amount denoting the state of active resource .
    • getExpectedWindowDataMetric

      public org.palladiosimulator.metricspec.MetricDescription getExpectedWindowDataMetric()
      Returns the MetricDescription all window data must adhere to in order to be processed by this aggregator.
      Returns:
      The MetricDescription of the data this instance is processing.
      See Also:
    • getAllowedWindowDataMetrics

      public static Collection<org.palladiosimulator.metricspec.MetricDescription> getAllowedWindowDataMetrics()
      Gets all data metrics that can be processed by instances of this class.
      Returns:
      An unmodifiable Collection of those MetricDescriptions which can be processed.