Class TriggeredProbe

java.lang.Object
org.palladiosimulator.probeframework.probes.Probe
org.palladiosimulator.probeframework.probes.TriggeredProbe
All Implemented Interfaces:
org.palladiosimulator.commons.designpatterns.IAbstractObservable<IProbeListener>, org.palladiosimulator.metricspec.metricentity.IMetricEntity
Direct Known Subclasses:
BasicTriggeredProbe, TriggeredProbeList

public abstract class TriggeredProbe extends Probe
Triggered probes measure as soon as their takeMeasurement method is invoked (with optional context parameter of type RequestContext, e.g., the thread that triggered the probe. This invocation triggers the template method doMeasure (with an optionally empty context). After doMeasure computed a new measurement, takeMeasurement further informs all registered observers about the newly available measurement. The method doMeasure itself has to be provided by classes inheriting from the this class.
  • Constructor Details

    • TriggeredProbe

      protected TriggeredProbe(org.palladiosimulator.metricspec.MetricDescription metricDescription)
      Default constructor.
      Parameters:
      metricDescription - The metric of the measurements delivered by this probe.
  • Method Details

    • takeMeasurement

      public ProbeMeasurement takeMeasurement()
      Takes a probe measurement. Convenience method for an empty request context; refer to @see #takeMeasurement(RequestContext) for full documentation.
      Returns:
      The taken probe measurement.
    • takeMeasurement

      public ProbeMeasurement takeMeasurement(RequestContext measurementContext)
      Takes a probe measurement for the given request context. This method is externally triggered, thus, being the main characteristic of this type of probe. Internally, the template method doMeasure is used to obtain the concrete measurement. Afterwards, all registered observers are informed about this new measurement.
      Parameters:
      measurementContext - The measurement context for this probe.
      Returns:
      The taken probe measurement.
    • doMeasure

      protected abstract ProbeMeasurement doMeasure(RequestContext measurementContext)
      Template method for taking the desired probe measurement in a given request context.
      Parameters:
      measurementContext - The measurement context for this probe.
      Returns:
      The taken probe measurement.