Class ExampleTakeCPUDemandProbe

  • All Implemented Interfaces:
    Observer, org.palladiosimulator.commons.designpatterns.IAbstractObservable<IProbeListener>, org.palladiosimulator.metricspec.metricentity.IMetricEntity

    public class ExampleTakeCPUDemandProbe
    extends BasicEventProbe<ASimpleActiveResource,​Double,​javax.measure.quantity.Duration>
    implements Observer
    Measures a resource demand metric (in SI.SECOND) by taking the demand emitted from an active resource (event source), e.g., a CPU. This class uses ASimpleActiveResource as an example active resource.
    • Constructor Detail

      • ExampleTakeCPUDemandProbe

        public ExampleTakeCPUDemandProbe​(ASimpleActiveResource activeResource)
        Default constructor.
        Parameters:
        activeResource - The event source is an active resource (e.g., a CPU), thus, able to emit demand events.
    • Method Detail

      • update

        public void update​(Observable eventSource,
                           Object event)
        Receives a new demand event from the active resource (event source). Afterwards, notifies all observers about this new measurement.
        Specified by:
        update in interface Observer
        Parameters:
        eventSource - The observed event source.
        event - The emitted event, including the demand measurement.