Class SimpleMetricsRecorder
java.lang.Object
io.camunda.zeebe.spring.client.metrics.SimpleMetricsRecorder
- All Implemented Interfaces:
MetricsRecorder
Super simple class to record metrics in memory.
Typically used for test cases
-
Field Summary
FieldsFields inherited from interface io.camunda.zeebe.spring.client.metrics.MetricsRecorder
ACTION_ACTIVATED, ACTION_BPMN_ERROR, ACTION_COMPLETED, ACTION_FAILED, METRIC_NAME_JOB, METRIC_NAME_MAX_JOBS_ACTIVE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteWithTimer(String metricName, String jobType, Runnable methodToExecute) Execute the given runnable and measure the execution timelongvoidIncrease the counter for the given metric name, action and typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.zeebe.spring.client.metrics.MetricsRecorder
increase
-
Field Details
-
counters
-
timers
-
-
Constructor Details
-
SimpleMetricsRecorder
public SimpleMetricsRecorder()
-
-
Method Details
-
increase
Description copied from interface:MetricsRecorderIncrease the counter for the given metric name, action and type- Specified by:
increasein interfaceMetricsRecorder- Parameters:
metricName- - the name of the metricaction- - event type within the metric, e.g. activated, completed, failed, bpmn-errortype- - type of the job the metric is forcount- - the amount to increase the metric by
-
executeWithTimer
Description copied from interface:MetricsRecorderExecute the given runnable and measure the execution timeNote: the provided runnable is executed synchronously
- Specified by:
executeWithTimerin interfaceMetricsRecorder- Parameters:
metricName- - the name of the metricjobType- - type of the job the metric is formethodToExecute- - the method to execute
-
getCount
-