Class SlidingWindowUtilizationAggregator
java.lang.Object
org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowAggregator
org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowUtilizationAggregator
- All Implemented Interfaces:
ISlidingWindowListener
- Direct Known Subclasses:
SlidingWindowExponentialSmoothingUtilizationAggregator
This class is a
The calculated utilization is passed to the attached
SlidingWindowAggregator 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 a
SlidingWindow. The calculated utilization is passed to the attached
IRecorder in the form of a
(point in time, utilization of active resource) tuple each time this implementation
processes new window data.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> -
Constructor Summary
ConstructorsConstructorDescriptionSlidingWindowUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.core.IRecorder recorderToWriteInto) Initializes a new instance of theSlidingWindowUtilizationAggregatorclass with the given parameter. -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<org.palladiosimulator.metricspec.MetricDescription>Gets all data metrics that can be processed by instances of this class.org.palladiosimulator.metricspec.MetricDescriptionReturns theMetricDescriptionall 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 timethe given measurement was taken.protected org.jscience.physics.amount.Amount<javax.measure.quantity.Dimensionless>obtainStateAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement) Gets thestate of active resourcemeasurement captured by the given measuring value.protected 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 org.palladiosimulator.experimentanalysis.windowaggregators.SlidingWindowAggregator
addRecorder, onSlidingWindowFull
-
Field Details
-
ZERO_DURATION
protected static final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> ZERO_DURATION
-
-
Constructor Details
-
SlidingWindowUtilizationAggregator
public SlidingWindowUtilizationAggregator(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.core.IRecorder recorderToWriteInto) Initializes a new instance of theSlidingWindowUtilizationAggregatorclass with the given parameter.- Parameters:
windowDataMetric- TheMetricDescriptionof the measurements to be processed, i.e, which are used to compute the utilization.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 either argument isnull.IllegalArgumentException- If the given metric is not supported by this aggregator.
-
-
Method Details
-
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:SlidingWindowAggregatorBy 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:
processWindowDatain classSlidingWindowAggregator- 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.
-
obtainPointInTimeAmountFromMeasurement
protected static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> obtainPointInTimeAmountFromMeasurement(org.palladiosimulator.measurementframework.MeasuringValue measurement) Gets thepoint in timethe given measurement was taken.- Parameters:
measurement- A (not null)MeasuringValueinstance containing apoint in timemeasure.- Returns:
- An
Amountthat represents thepoint in timethe 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 resourcemeasurement captured by the given measuring value.- Parameters:
measurement- A (not null)MeasuringValueinstance containing a dimensionlessstate of active resourcemeasurement, or, in case of multi-core utilization, autilization of active resourcemeasurement.- Returns:
- A
DimensionlessAmountdenoting thestate of active resource.
-
getExpectedWindowDataMetric
public org.palladiosimulator.metricspec.MetricDescription getExpectedWindowDataMetric()Returns theMetricDescriptionall window data must adhere to in order to be processed by this aggregator.- Returns:
- The
MetricDescriptionof the data this instance is processing. - See Also:
-
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
Collectionof thoseMetricDescriptions which can be processed.
-