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 allISlidingWindowListenerthat aggregate/process the measurements collected by aSlidingWindowonce 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:
SlidingWindowRecorder
-
-
Constructor Summary
Constructors Constructor Description SlidingWindowAggregator()Initializes a new instance of theSlidingWindowAggregatorclass which shall not be connected to a recorder (data sink) yet.SlidingWindowAggregator(Collection<org.palladiosimulator.recorderframework.IRecorder> recordersToWriteInto)Initializes a new instance of theSlidingWindowAggregatorclass with the given parameter.SlidingWindowAggregator(org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)Initializes a new instance of theSlidingWindowAggregatorclass with the given parameter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddRecorder(org.palladiosimulator.recorderframework.IRecorder recorder)voidonSlidingWindowFull(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.MeasuringValueprocessWindowData(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 Detail
-
SlidingWindowAggregator
public SlidingWindowAggregator()
Initializes a new instance of theSlidingWindowAggregatorclass which shall not be connected to a recorder (data sink) yet.- See Also:
addRecorder(IRecorder)
-
SlidingWindowAggregator
public SlidingWindowAggregator(org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)
Initializes a new instance of theSlidingWindowAggregatorclass with the given parameter.- Parameters:
recorderToWriteInto- AnIRecorderthis 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 givenIRecorderisnull.
-
SlidingWindowAggregator
public SlidingWindowAggregator(Collection<org.palladiosimulator.recorderframework.IRecorder> recordersToWriteInto)
Initializes a new instance of theSlidingWindowAggregatorclass with the given parameter.- Parameters:
recordersToWriteInto- A @CollectionofIRecorders 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 ofIRecorders isnull.IllegalArgumentException- If the given collection of recorders is empty.
-
-
Method Detail
-
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- AMeasuredenoting the new left bound of the sliding window.windowLength- AMeasuredenoting the length of the sliding window.- Returns:
- A
MeasuringValuethat 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:ISlidingWindowListenerThis callback method is triggered by each observed window once it is full, that is, just before it is about to move on.- Specified by:
onSlidingWindowFullin interfaceISlidingWindowListener- Parameters:
windowData- AnIterablecontaining the currently collected window data, that is, allMeasuringValues within the window's current bounds.windowLeftBound- AMeasuredenoting the window's current lower/left bound.windowLength- AMeasuredenoting the current window length.
-
-