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 (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.-
Field Summary
Fields inherited from class org.palladiosimulator.probeframework.probes.EventProbe
eventSource
Fields inherited from class org.palladiosimulator.probeframework.probes.Probe
metricEntityDelegate
-
Constructor Summary
ConstructorDescriptionExampleTakeCPUDemandProbe
(ASimpleActiveResource activeResource) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.palladiosimulator.metricspec.metricentity.IMetricEntity
getMetricDesciption, isCompatibleWith
-
Constructor Details
-
ExampleTakeCPUDemandProbe
Default constructor.- Parameters:
activeResource
- The event source is an active resource (e.g., a CPU), thus, able to emit demand events.
-
-
Method Details
-
registerListener
protected void registerListener()Template method for registering observers to the event source.- Specified by:
registerListener
in classEventProbe<ASimpleActiveResource>
-
update
Receives a new demand event from the active resource (event source). Afterwards, notifies all observers about this new measurement.
-