Class SlidingWindowUtilizationAggregator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> ZERO_DURATION  
    • 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 the MetricDescription 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 the point in time the given measurement was taken.
      protected org.jscience.physics.amount.Amount<javax.measure.quantity.Dimensionless> obtainStateAmountFromMeasurement​(org.palladiosimulator.measurementframework.MeasuringValue measurement)
      Gets the state 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.
    • Field Detail

      • ZERO_DURATION

        protected static final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> ZERO_DURATION
    • Constructor Detail

      • SlidingWindowUtilizationAggregator

        public SlidingWindowUtilizationAggregator​(org.palladiosimulator.metricspec.MetricDescription windowDataMetric,
                                                  org.palladiosimulator.recorderframework.IRecorder recorderToWriteInto)
        Initializes a new instance of the SlidingWindowUtilizationAggregator class with the given parameter.
        Parameters:
        windowDataMetric - The MetricDescription of the measurements to be processed, i.e, which are used to compute the utilization.
        recorderToWriteInto - An IRecorder 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 is null.
        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 class SlidingWindowAggregator
        Parameters:
        windowData - The window data to be processed.
        windowLeftBound - A Measure denoting the new left bound of the sliding window.
        windowLength - A Measure 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 the point in time the given measurement was taken.
        Parameters:
        measurement - A (not null) MeasuringValue instance containing a point in time measure.
        Returns:
        An Amount that represents the point 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 the state of active resource measurement captured by the given measuring value.
        Parameters:
        measurement - A (not null) MeasuringValue instance containing a dimensionless state of active resource measurement, or, in case of multi-core utilization, a utilization of active resource measurement.
        Returns:
        A Dimensionless Amount denoting the state of active resource .
      • getExpectedWindowDataMetric

        public org.palladiosimulator.metricspec.MetricDescription getExpectedWindowDataMetric()
        Returns the MetricDescription 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 those MetricDescriptions which can be processed.