Class ExampleTakeCPUDemandProbe
- java.lang.Object
-
- org.palladiosimulator.probeframework.probes.Probe
-
- org.palladiosimulator.probeframework.probes.EventProbe<EventSourceType>
-
- org.palladiosimulator.probeframework.probes.BasicEventProbe<ASimpleActiveResource,Double,javax.measure.quantity.Duration>
-
- org.palladiosimulator.probeframework.probes.example.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 (inSI.SECOND
) by taking the demand emitted from an active resource (event source), e.g., a CPU. This class usesASimpleActiveResource
as an example active resource.
-
-
Field Summary
-
Fields inherited from class org.palladiosimulator.probeframework.probes.EventProbe
eventSource
-
Fields inherited from class org.palladiosimulator.probeframework.probes.Probe
metricEntityDelegate
-
-
Constructor Summary
Constructors Constructor Description ExampleTakeCPUDemandProbe(ASimpleActiveResource activeResource)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
registerListener()
Template method for registering observers to the event source.void
update(Observable eventSource, Object event)
Receives a new demand event from the active resource (event source).-
Methods inherited from class org.palladiosimulator.probeframework.probes.BasicEventProbe
notify
-
Methods inherited from class org.palladiosimulator.probeframework.probes.Probe
addObserver, getMetricDesciption, isCompatibleWith, notifyMeasurementSourceListener, removeObserver
-
-
-
-
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
-
registerListener
protected void registerListener()
Template method for registering observers to the event source.- Specified by:
registerListener
in classEventProbe<ASimpleActiveResource>
-
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.
-
-