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
ConstructorDescriptionInitializes a new instance of theSlidingWindowAggregator
class which shall not be connected to a recorder (data sink) yet.SlidingWindowAggregator
(Collection<org.palladiosimulator.recorderframework.IRecorder> recordersToWriteInto) Initializes a new instance of theSlidingWindowAggregator
class with the given parameter.SlidingWindowAggregator
(org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto) Initializes a new instance of theSlidingWindowAggregator
class with the given parameter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 theSlidingWindowAggregator
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 theSlidingWindowAggregator
class with the given parameter.- Parameters:
recorderToWriteInto
- AnIRecorder
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 givenIRecorder
isnull
.
-
SlidingWindowAggregator
public SlidingWindowAggregator(Collection<org.palladiosimulator.recorderframework.IRecorder> recordersToWriteInto) Initializes a new instance of theSlidingWindowAggregator
class with the given parameter.- Parameters:
recordersToWriteInto
- A @Collection
ofIRecorder
s 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 ofIRecorder
s isnull
.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
- AMeasure
denoting the new left bound of the sliding window.windowLength
- AMeasure
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 interfaceISlidingWindowListener
- Parameters:
windowData
- AnIterable
containing the currently collected window data, that is, allMeasuringValue
s within the window's current bounds.windowLeftBound
- AMeasure
denoting the window's current lower/left bound.windowLength
- AMeasure
denoting the current window length.
-