Class SimpleMetricsRecorder

java.lang.Object
io.camunda.spring.client.metrics.SimpleMetricsRecorder
All Implemented Interfaces:
MetricsRecorder

public class SimpleMetricsRecorder extends Object implements MetricsRecorder
Super simple class to record metrics in memory. Typically used for test cases
  • Field Details

  • Constructor Details

    • SimpleMetricsRecorder

      public SimpleMetricsRecorder()
  • Method Details

    • increase

      public void increase(String metricName, String action, String type, int count)
      Description copied from interface: MetricsRecorder
      Increase the counter for the given metric name, action and type
      Specified by:
      increase in interface MetricsRecorder
      Parameters:
      metricName - - the name of the metric
      action - - event type within the metric, e.g. activated, completed, failed, bpmn-error
      type - - type of the job the metric is for
      count - - the amount to increase the metric by
    • executeWithTimer

      public void executeWithTimer(String metricName, String jobType, Runnable methodToExecute)
      Description copied from interface: MetricsRecorder
      Execute the given runnable and measure the execution time

      Note: the provided runnable is executed synchronously

      Specified by:
      executeWithTimer in interface MetricsRecorder
      Parameters:
      metricName - - the name of the metric
      jobType - - type of the job the metric is for
      methodToExecute - - the method to execute
    • getCount

      public long getCount(String metricName, String action, String type)