Class SlidingWindowExponentialSmoothingUtilizationAggregator
- java.lang.Object
-
- org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowAggregator
-
- org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowUtilizationAggregator
-
- org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowExponentialSmoothingUtilizationAggregator
-
- All Implemented Interfaces:
ISlidingWindowListener
public final class SlidingWindowExponentialSmoothingUtilizationAggregator extends SlidingWindowUtilizationAggregator
This class is a specializedSlidingWindowUtilizationAggregator
implementation which calculates the utilization or, (which is more precisely in the scope of this class), the average load) 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 aSlidingWindow
by employing the algorithm that is used in the Linux kernel to compute the average load (Details of this algorithm can be found in this paper, or more succinctly, in this presentation both due to Neil Gunther).
The calculated load is passed to all attachedIRecorder
s in the form of a(point in time, utilization of active resource)
tuple each time this implementation processes new window data. Such a point in time is referred to as reporting period and equal to the length of the correspondingSlidingWindow
.
Note: The afore-mentioned algorithm is a special case of exponential smoothing with the smoothing factorα
derived from the given sampling rate and reporting period.
-
-
Field Summary
-
Fields inherited from class org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowUtilizationAggregator
ZERO_DURATION
-
-
Constructor Summary
Constructors Constructor Description SlidingWindowExponentialSmoothingUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto, javax.measure.Measurable<javax.measure.quantity.Duration> samplingRate, javax.measure.Measurable<javax.measure.quantity.Duration> reportingPeriod)
Initializes a new instance of theSlidingWindowExponentialSmoothingUtilizationAggregator
class with the given arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.measure.Measurable<javax.measure.quantity.Duration>
getSamplingRate()
double
getSmoothingFactor()
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.SlidingWindowUtilizationAggregator
getAllowedWindowDataMetrics, getExpectedWindowDataMetric, obtainPointInTimeAmountFromMeasurement, obtainStateAmountFromMeasurement
-
Methods inherited from class org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowAggregator
addRecorder, onSlidingWindowFull
-
-
-
-
Constructor Detail
-
SlidingWindowExponentialSmoothingUtilizationAggregator
public SlidingWindowExponentialSmoothingUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto, javax.measure.Measurable<javax.measure.quantity.Duration> samplingRate, javax.measure.Measurable<javax.measure.quantity.Duration> reportingPeriod)
Initializes a new instance of theSlidingWindowExponentialSmoothingUtilizationAggregator
class with the given arguments.- Parameters:
windowDataMetric
- TheMetricDescription
of the measurements to be processed, i.e, which are used to compute the utilization.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.samplingRate
- AnAmount
denoting the sampling rate which equals the increment of the associatedSlidingWindow
.
For instance, if the given amount is 5s, the average load/utilization is updated every 5 seconds, starting at the window's left bound.reportingPeriod
- AnAmount
describing the reporting period which is simply the length of the associatedSlidingWindow
.
For instance, if the given amount is 1min, the computed average load/utilization is forwarded every minute to the attached recorders.- Throws:
NullPointerException
- If any of the arguments isnull
.IllegalArgumentException
- If the given metric is not supported by this aggregator, or either of the given amounts is not positive.
-
-
Method Detail
-
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.- Overrides:
processWindowData
in classSlidingWindowUtilizationAggregator
- 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.
-
getSamplingRate
public javax.measure.Measurable<javax.measure.quantity.Duration> getSamplingRate()
-
getSmoothingFactor
public double getSmoothingFactor()
-
-