Class KeepLastElementPriorToLowerBoundStrategy
- java.lang.Object
-
- org.palladiosimulator.experimentanalysis.KeepLastElementPriorToLowerBoundStrategy
-
- All Implemented Interfaces:
ISlidingWindowMoveOnStrategy
public final class KeepLastElementPriorToLowerBoundStrategy extends Object implements ISlidingWindowMoveOnStrategy
An implementation ofISlidingWindowMoveOnStrategythat keeps exactly one measurement that is prior to the new lower bound of theSlidingWindowafter it moved on. More precisely, the very last measurement prior to the new lower bound is maintained, while all preceding ones are discarded. If all measurements are within the new bounds of the window, this implementation does nothing.
Main use case of this strategy is the calculation of a resource's utilization (cf.SlidingWindowUtilizationAggregator).
-
-
Constructor Summary
Constructors Constructor Description KeepLastElementPriorToLowerBoundStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadjustData(Deque<org.palladiosimulator.measurementframework.MeasuringValue> currentData, javax.measure.Measure<Double,javax.measure.quantity.Duration> newLowerBound, javax.measure.Measure<Double,javax.measure.quantity.Duration> increment)This method specifies how the collected data (i.e., the measurements) are adjusted when the window moves forward.
-
-
-
Method Detail
-
adjustData
public void adjustData(Deque<org.palladiosimulator.measurementframework.MeasuringValue> currentData, javax.measure.Measure<Double,javax.measure.quantity.Duration> newLowerBound, javax.measure.Measure<Double,javax.measure.quantity.Duration> increment)
Description copied from interface:ISlidingWindowMoveOnStrategyThis method specifies how the collected data (i.e., the measurements) are adjusted when the window moves forward. It is called by the associatedSlidingWindowinstance each time it has moved forward.
Note that the adjustment of the data has to be done in-place.- Specified by:
adjustDatain interfaceISlidingWindowMoveOnStrategy- Parameters:
currentData- ADequecontaining the window data (i.e., the collected measurements) at the moment it moved forward. The adjustment of the data has to be done in-place, i.e., this Deque has to be manipulated directly.newLowerBound- A point in time (in seconds) denoting the new lower bound of the window.increment- AMeasureindicating by what the window moved forward.
-
-