Class ExampleTakeCPUStateProbe
- java.lang.Object
-
- org.palladiosimulator.probeframework.probes.Probe
-
- org.palladiosimulator.probeframework.probes.TriggeredProbe
-
- org.palladiosimulator.probeframework.probes.BasicTriggeredProbe<V,Q>
-
- org.palladiosimulator.probeframework.probes.BasicObjectStateProbe<ASimpleActiveResource,Long,javax.measure.quantity.Dimensionless>
-
- org.palladiosimulator.probeframework.probes.example.ExampleTakeCPUStateProbe
-
- All Implemented Interfaces:
org.palladiosimulator.commons.designpatterns.IAbstractObservable<IProbeListener>
,org.palladiosimulator.metricspec.metricentity.IMetricEntity
public class ExampleTakeCPUStateProbe extends BasicObjectStateProbe<ASimpleActiveResource,Long,javax.measure.quantity.Dimensionless>
Measures an active resource state metric (dimensionless) by taking the current number of jobs within an active resource (observed state object), e.g., a CPU. This class usesASimpleActiveResource
as an example active resource.
-
-
Field Summary
-
Fields inherited from class org.palladiosimulator.probeframework.probes.Probe
metricEntityDelegate
-
-
Constructor Summary
Constructors Constructor Description ExampleTakeCPUStateProbe(ASimpleActiveResource myCpu)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.measure.Measure<Long,javax.measure.quantity.Dimensionless>
getBasicMeasure(RequestContext measurementContext)
Measures the current jobs as requested from the active CPU resource (observed state object).-
Methods inherited from class org.palladiosimulator.probeframework.probes.BasicObjectStateProbe
getStateObject
-
Methods inherited from class org.palladiosimulator.probeframework.probes.BasicTriggeredProbe
doMeasure
-
Methods inherited from class org.palladiosimulator.probeframework.probes.TriggeredProbe
takeMeasurement, takeMeasurement
-
Methods inherited from class org.palladiosimulator.probeframework.probes.Probe
addObserver, getMetricDesciption, isCompatibleWith, notifyMeasurementSourceListener, removeObserver
-
-
-
-
Constructor Detail
-
ExampleTakeCPUStateProbe
public ExampleTakeCPUStateProbe(ASimpleActiveResource myCpu)
Default constructor.- Parameters:
myCpu
- The observer object is a CPU, thus, allowing to request its current jobs.
-
-
Method Detail
-
getBasicMeasure
protected javax.measure.Measure<Long,javax.measure.quantity.Dimensionless> getBasicMeasure(RequestContext measurementContext)
Measures the current jobs as requested from the active CPU resource (observed state object).- Specified by:
getBasicMeasure
in classBasicTriggeredProbe<Long,javax.measure.quantity.Dimensionless>
- Parameters:
measurementContext
- The measurement context for this probe.- Returns:
- The new measure.
-
-