Class SlidingWindowAggregator

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

public abstract class SlidingWindowAggregator extends Object implements ISlidingWindowListener
This class is the base class of all ISlidingWindowListener that aggregate/process the measurements collected by a SlidingWindow once it is full (i.e., it moved on).
In terms of signal processing and time series analysis/statistics, this class can be thought of as a base class for any moving average implementation.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes a new instance of the SlidingWindowAggregator class which shall not be connected to a recorder (data sink) yet.
    SlidingWindowAggregator(Collection<org.palladiosimulator.recorderframework.IRecorder> recordersToWriteInto)
    Initializes a new instance of the SlidingWindowAggregator class with the given parameter.
    SlidingWindowAggregator(org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)
    Initializes a new instance of the SlidingWindowAggregator class with the given parameter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addRecorder(org.palladiosimulator.recorderframework.IRecorder recorder)
     
    final void
    onSlidingWindowFull(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> windowData, javax.measure.Measure<Double,javax.measure.quantity.Duration> windowLeftBound, javax.measure.Measure<Double,javax.measure.quantity.Duration> windowLength)
    This callback method is triggered by each observed window once it is full, that is, just before it is about to move on.
    protected abstract 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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.palladiosimulator.experimentanalysis.ISlidingWindowListener

    getExpectedWindowDataMetric
  • Constructor Details

    • SlidingWindowAggregator

      public SlidingWindowAggregator()
      Initializes a new instance of the SlidingWindowAggregator class which shall not be connected to a recorder (data sink) yet.
      See Also:
    • SlidingWindowAggregator

      public SlidingWindowAggregator(org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)
      Initializes a new instance of the SlidingWindowAggregator class with the given parameter.
      Parameters:
      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 the given IRecorder is null.
    • SlidingWindowAggregator

      public SlidingWindowAggregator(Collection<org.palladiosimulator.recorderframework.IRecorder> recordersToWriteInto)
      Initializes a new instance of the SlidingWindowAggregator class with the given parameter.
      Parameters:
      recordersToWriteInto - A @Collection of IRecorders this instance writes the aggregated window data into. Typically, recorders that write data into persistence frameworks like EDP 2 are passed here.
      Throws:
      NullPointerException - If the given collection of IRecorders is null.
      IllegalArgumentException - If the given collection of recorders is empty.
  • Method Details

    • addRecorder

      public void addRecorder(org.palladiosimulator.recorderframework.IRecorder recorder)
    • processWindowData

      protected abstract 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.
      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.
    • onSlidingWindowFull

      public final void onSlidingWindowFull(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 interface: ISlidingWindowListener
      This callback method is triggered by each observed window once it is full, that is, just before it is about to move on.
      Specified by:
      onSlidingWindowFull in interface ISlidingWindowListener
      Parameters:
      windowData - An Iterable containing the currently collected window data, that is, all MeasuringValues within the window's current bounds.
      windowLeftBound - A Measure denoting the window's current lower/left bound.
      windowLength - A Measure denoting the current window length.