Class ExampleTakePassiveResourceStateProbe

All Implemented Interfaces:
org.palladiosimulator.commons.designpatterns.IAbstractObservable<IProbeListener>, org.palladiosimulator.metricspec.metricentity.IMetricEntity

public class ExampleTakePassiveResourceStateProbe extends BasicObjectStateProbe<ASimplePassiveResource,Long,javax.measure.quantity.Dimensionless>
Measures a passive resource state metric (dimensionless) by taking the number of free resources within a passive resource (observed state object), e.g., a connection pool. This class uses ASimplePassiveResource as an example passive resource.
  • Constructor Details

    • ExampleTakePassiveResourceStateProbe

      public ExampleTakePassiveResourceStateProbe(ASimplePassiveResource passiveResource)
      Default constructor.
      Parameters:
      passiveResource - The observer object is a passive resource, thus, allowing to request its free resources.
  • Method Details

    • getBasicMeasure

      protected javax.measure.Measure<Long,javax.measure.quantity.Dimensionless> getBasicMeasure(RequestContext measurementContext)
      Measures the free resources as requested from the passive resource (observed state object).
      Specified by:
      getBasicMeasure in class BasicTriggeredProbe<Long,javax.measure.quantity.Dimensionless>
      Parameters:
      measurementContext - The measurement context for this probe.
      Returns:
      The new measure.