Class EventBasedProbe<V,Q extends javax.measure.quantity.Quantity>
java.lang.Object
org.palladiosimulator.probeframework.probes.Probe
org.palladiosimulator.analyzer.slingshot.monitor.probes.EventBasedProbe<V,Q>
- Type Parameters:
V
- The value type of the measurement.Q
- The quantity type of the measurement.
- All Implemented Interfaces:
org.palladiosimulator.commons.designpatterns.IAbstractObservable<org.palladiosimulator.probeframework.probes.listener.IProbeListener>
,org.palladiosimulator.metricspec.metricentity.IMetricEntity
- Direct Known Subclasses:
EventBasedBasicProbe
,EventBasedListProbe
public abstract class EventBasedProbe<V,Q extends javax.measure.quantity.Quantity>
extends org.palladiosimulator.probeframework.probes.Probe
A probe that is
DESEvent
-based. Measurements/Probes are taken when
the associated DESEvent
was published.-
Field Summary
Fields inherited from class org.palladiosimulator.probeframework.probes.Probe
metricEntityDelegate
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EventBasedProbe
(org.palladiosimulator.metricspec.MetricDescription metricDescription) Constructs an event-based probe withEventDistinguisher.DEFAULT_DISTINGUISHER
.EventBasedProbe
(org.palladiosimulator.metricspec.MetricDescription metricDescription, EventDistinguisher distinguisher) Constructs an event-based probe. -
Method Summary
Modifier and TypeMethodDescriptiongetMeasurement
(org.palladiosimulator.analyzer.slingshot.common.events.DESEvent event) An implementation that returns aMeasure
from anDESEvent
.protected abstract org.palladiosimulator.probeframework.measurement.ProbeMeasurement
getProbeMeasurement
(org.palladiosimulator.analyzer.slingshot.common.events.DESEvent event) Get aProbeMeasurement
from anDESEvent
.void
takeMeasurement
(org.palladiosimulator.analyzer.slingshot.common.events.DESEvent event) Takes a measurement of the event type.Methods inherited from class org.palladiosimulator.probeframework.probes.Probe
addObserver, getMetricDesciption, isCompatibleWith, notifyMeasurementSourceListener, removeObserver
-
Constructor Details
-
EventBasedProbe
protected EventBasedProbe(org.palladiosimulator.metricspec.MetricDescription metricDescription) Constructs an event-based probe withEventDistinguisher.DEFAULT_DISTINGUISHER
.- Parameters:
eventType
- The event type to listen to.metricDescription
- A metric description needed by the super-class.
-
EventBasedProbe
public EventBasedProbe(org.palladiosimulator.metricspec.MetricDescription metricDescription, EventDistinguisher distinguisher) Constructs an event-based probe.- Parameters:
eventType
- The event type to listen to.metricDescription
- A metric description needed by the super-class.distinguisher
- The distinguisher that is used for creatingRequestContext
s.
-
-
Method Details
-
takeMeasurement
public void takeMeasurement(org.palladiosimulator.analyzer.slingshot.common.events.DESEvent event) Takes a measurement of the event type. The passed event must be of the given type by#getEventType()
.This calls
#getMeasure(DESEvent)
and wraps it into aProbeMeasurement
and notifies the listeners.- Parameters:
event
- The event that happened and is of type#getEventType()
.- Throws:
IllegalArgumentException
- if the passed event is not of the type returned by#getEventType()
.- See Also:
-
getMeasurement
public abstract javax.measure.Measure<V,Q> getMeasurement(org.palladiosimulator.analyzer.slingshot.common.events.DESEvent event) An implementation that returns aMeasure
from anDESEvent
. That measure is needed bytakeMeasurement(DESEvent)
.- Parameters:
event
- The event that happened.- Returns:
- A
Measure
from the event.
-
getProbeMeasurement
protected abstract org.palladiosimulator.probeframework.measurement.ProbeMeasurement getProbeMeasurement(org.palladiosimulator.analyzer.slingshot.common.events.DESEvent event) Get aProbeMeasurement
from anDESEvent
. Depending on the type of probe, the measurementsIMeasureProvider
may differ.- Parameters:
event
- The event that happened.- Returns:
- A
ProbeMeasurement
from the event.
-
getDistinguisher
-