Class LRAMetricService

java.lang.Object
org.eclipse.microprofile.lra.tck.service.LRAMetricService

@ApplicationScoped public class LRAMetricService extends Object
Metric service is a storage container that test beans may use to store data about processing. It stores number of call types (defined by LRAMetricService.LRAMetric) per LRA id per participant.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the metric storage as whole.
    int
    getMetric(LRAMetricType metricType, URI lraId)
    Returns count number for particular metric type.
    int
    getMetric(LRAMetricType metricType, URI lraId, Class<?> participantClazz)
    Returns count number for particular metric type filtered by LRA id and the participant class which defines the participant name (the fully qualified class name is used for it).
    int
    getMetric(LRAMetricType metricType, URI lraId, String participantClassName)
    Returns count number for particular metric type filtered by LRA id and the participant's name.
    int
    Returns count number for particular metric type regardless of the LRA id or the participant's name.
    void
    incrementMetric(LRAMetricType metricType, URI lraId, Class<?> participantClazz)
    It increments counter of the metric type for particular LRA id and particular participant class which is translated to fully qualified class name as participant name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LRAMetricService

      public LRAMetricService()
  • Method Details

    • incrementMetric

      public void incrementMetric(LRAMetricType metricType, URI lraId, Class<?> participantClazz)
      It increments counter of the metric type for particular LRA id and particular participant class which is translated to fully qualified class name as participant name.
      Parameters:
      metricType - increment counter of the specific metric type
      lraId - increment counter of the metric type assigned to this particular lra id
      participantClazz - the participant class which the metric increment is accounted to
    • getMetricAll

      public int getMetricAll(LRAMetricType metricType)
      Returns count number for particular metric type regardless of the LRA id or the participant's name.
      Parameters:
      metricType - metric type to take sum of the metric counter for
      Returns:
      sum of metric counters if of the particular metric type
    • getMetric

      public int getMetric(LRAMetricType metricType, URI lraId)
      Returns count number for particular metric type.
      Parameters:
      metricType - counter for which the metric type will be returned
      lraId - counter for which lra id will be returned
      Returns:
      metric counter defined based on the method parameters
    • getMetric

      public int getMetric(LRAMetricType metricType, URI lraId, Class<?> participantClazz)
      Returns count number for particular metric type filtered by LRA id and the participant class which defines the participant name (the fully qualified class name is used for it).
      Parameters:
      metricType - counter for which the metric type will be returned
      lraId - counter for which lra id will be returned
      participantClazz - counter for which the participant will be returned
      Returns:
      metric counter defined based on the method parameters
    • getMetric

      public int getMetric(LRAMetricType metricType, URI lraId, String participantClassName)
      Returns count number for particular metric type filtered by LRA id and the participant's name. It's expected that the participant name is defined as fully qualified participant class name.
      Parameters:
      metricType - counter for which metric type will be returned
      lraId - counter for which lra id will be returned
      participantClassName - counter for which the participant name will be returned
      Returns:
      metric counter defined based on the method parameters
    • clear

      public void clear()
      Clear the metric storage as whole.