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
Modifier and TypeFieldDescriptionprotected static final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>
-
Constructor Summary
ConstructorDescriptionSlidingWindowUtilizationAggregator
(org.palladiosimulator.metricspec.MetricDescription windowDataMetric, org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto) Initializes a new instance of theSlidingWindowUtilizationAggregator
class 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.MetricDescription
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
-
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.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 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: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:
-
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.
-