Class SlidingWindowAggregator
java.lang.Object
org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowAggregator
- All Implemented Interfaces:
ISlidingWindowListener
- Direct Known Subclasses:
SlidingWindowUtilizationAggregator
This class is the base class of all
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.
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
ConstructorsConstructorDescriptionInitializes a new instance of theSlidingWindowAggregatorclass which shall not be connected to a recorder (data sink) yet.SlidingWindowAggregator(Collection<org.palladiosimulator.recorderframework.core.IRecorder> recordersToWriteInto) Initializes a new instance of theSlidingWindowAggregatorclass with the given parameter.SlidingWindowAggregator(org.palladiosimulator.recorderframework.core.IRecorder recorderToWriteInto) Initializes a new instance of theSlidingWindowAggregatorclass with the given parameter. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecorder(org.palladiosimulator.recorderframework.core.IRecorder recorder) final 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, waitMethods inherited from interface org.palladiosimulator.experimentanalysis.ISlidingWindowListener
getExpectedWindowDataMetric
-
Constructor Details
-
SlidingWindowAggregator
public SlidingWindowAggregator()Initializes a new instance of theSlidingWindowAggregatorclass which shall not be connected to a recorder (data sink) yet.- See Also:
-
SlidingWindowAggregator
public SlidingWindowAggregator(org.palladiosimulator.recorderframework.core.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.core.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 Details
-
addRecorder
public void addRecorder(org.palladiosimulator.recorderframework.core.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.
-