Interface MicrometerJobWorkerMetricsBuilder
- All Known Implementing Classes:
MicrometerJobWorkerMetricsBuilderImpl
public interface MicrometerJobWorkerMetricsBuilder
Builder interface for the
JobWorkerMetrics
backed by Micrometer. This is an optional
feature which requires you to add Micrometer to your
classpath (see the installation guide for
more).
This will create a JobWorkerMetrics
implementation which will track the following
metrics:
- A counter for the jobs activated count
- A counter for the jobs handled count
NOTE: the names may be changed depending on the registry backing Micrometer (e.g. Prometheus names will replace the periods with underscore, etc.)
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Set of possible metrics/metric names. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
withMeterRegistry
(io.micrometer.core.instrument.MeterRegistry meterRegistry) Specifies where the worker metrics will be registered.Tags which will be applied to all worker metrics.
-
Method Details
-
withMeterRegistry
MicrometerJobWorkerMetricsBuilder withMeterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry) Specifies where the worker metrics will be registered. If null,Metrics.globalRegistry
is used.- Parameters:
meterRegistry
- the meter registry to use- Returns:
- this builder for chaining
-
withTags
Tags which will be applied to all worker metrics. Can be null.- Parameters:
tags
- the tags to apply to all metrics- Returns:
- this builder for chaining
-
build
JobWorkerMetrics build()
-