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
eventSourceFields inherited from class org.palladiosimulator.probeframework.probes.Probe
metricEntityDelegate -
Constructor Summary
ConstructorsConstructorDescriptionExampleTakeCPUDemandProbe(ASimpleActiveResource activeResource) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidTemplate method for registering observers to the event source.voidupdate(Observable eventSource, Object event) Receives a new demand event from the active resource (event source).Methods inherited from class org.palladiosimulator.probeframework.probes.BasicEventProbe
notifyMethods inherited from class org.palladiosimulator.probeframework.probes.Probe
addObserver, getMetricDesciption, isCompatibleWith, notifyMeasurementSourceListener, removeObserverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
registerListenerin classEventProbe<ASimpleActiveResource>
-
update
Receives a new demand event from the active resource (event source). Afterwards, notifies all observers about this new measurement.
-