Class SlidingWindowUtilizationAggregator
- java.lang.Object
-
- org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowAggregator
-
- org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowUtilizationAggregator
-
- All Implemented Interfaces:
ISlidingWindowListener
- Direct Known Subclasses:
SlidingWindowExponentialSmoothingUtilizationAggregator
public class SlidingWindowUtilizationAggregator extends SlidingWindowAggregator
This class is aSlidingWindowAggregator
implementation which calculates the utilization 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
.
The calculated utilization is passed to the attachedIRecorder
in the form of a(point in time, utilization of active resource)
tuple each time this implementation processes new window data.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
ZERO_DURATION
-
Constructor Summary
Constructors Constructor Description SlidingWindowUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)
Initializes a new instance of theSlidingWindowUtilizationAggregator
class with the given parameter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Collection<org.palladiosimulator.metricspec.MetricDescription>
getAllowedWindowDataMetrics()
Gets all data metrics that can be processed by instances of this class.org.palladiosimulator.metricspec.MetricDescription
getExpectedWindowDataMetric()
Returns theMetricDescription
all window data must adhere to in order to be processed by this aggregator.protected static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
obtainPointInTimeAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
Gets thepoint in time
the given measurement was taken.protected org.jscience.physics.amount.Amount<javax.measure.quantity.Dimensionless>
obtainStateAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
Gets thestate of active resource
measurement captured by the given measuring value.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.SlidingWindowAggregator
addRecorder, onSlidingWindowFull
-
-
-
-
Constructor Detail
-
SlidingWindowUtilizationAggregator
public SlidingWindowUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)
Initializes a new instance of theSlidingWindowUtilizationAggregator
class with the given parameter.- 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.- Throws:
NullPointerException
- If either argument isnull
.IllegalArgumentException
- If the given metric is not supported by this aggregator.
-
-
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.- Specified by:
processWindowData
in classSlidingWindowAggregator
- 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.
-
obtainPointInTimeAmountFromMeasurement
protected static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> obtainPointInTimeAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
Gets thepoint in time
the given measurement was taken.- Parameters:
measurement
- A (not null
)MeasuringValue
instance containing apoint in time
measure.- Returns:
- An
Amount
that represents thepoint in time
the given measurement was taken.
-
obtainStateAmountFromMeasurement
protected org.jscience.physics.amount.Amount<javax.measure.quantity.Dimensionless> obtainStateAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement)
Gets thestate of active resource
measurement captured by the given measuring value.- Parameters:
measurement
- A (not null
)MeasuringValue
instance containing a dimensionlessstate of active resource
measurement, or, in case of multi-core utilization, autilization of active resource
measurement.- Returns:
- A
Dimensionless
Amount
denoting thestate of active resource
.
-
getExpectedWindowDataMetric
public org.palladiosimulator.metricspec.MetricDescription getExpectedWindowDataMetric()
Returns theMetricDescription
all window data must adhere to in order to be processed by this aggregator.- Returns:
- The
MetricDescription
of the data this instance is processing. - See Also:
ISlidingWindowListener
,SlidingWindow.getAcceptedMetric()
-
getAllowedWindowDataMetrics
public static Collection<org.palladiosimulator.metricspec.MetricDescription> getAllowedWindowDataMetrics()
Gets all data metrics that can be processed by instances of this class.- Returns:
- An unmodifiable
Collection
of thoseMetricDescription
s which can be processed.
-
-