Class SwitchingMetricsService
java.lang.Object
eu.rarogsoftware.rarog.platform.core.metrics.SwitchingMetricsService
- All Implemented Interfaces:
MetricsService
@Primary
@Component
@ExportComponent
public class SwitchingMetricsService
extends Object
implements MetricsService
-
Constructor Summary
ConstructorsConstructorDescriptionSwitchingMetricsService
(ApplicationSettings applicationSettings, PrometheusMetricsService prometheusMetricsService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
closeMetric
(BasicMetric metric) Close instance of metric.createCounter
(MetricSettings settings) createGauge
(MetricSettings settings) createHistogram
(HistogramSettings settings) createInfo
(MetricSettings settings) void
sample()
Get last known state of all metrics in system.snapshot()
Gets snapshot state of metrics active in current moment.
-
Constructor Details
-
SwitchingMetricsService
public SwitchingMetricsService(ApplicationSettings applicationSettings, PrometheusMetricsService prometheusMetricsService)
-
-
Method Details
-
createCounter
- Specified by:
createCounter
in interfaceMetricsService
- Parameters:
settings
- metric settings- Returns:
- new instance of
Counter
metric
-
createGauge
- Specified by:
createGauge
in interfaceMetricsService
- Parameters:
settings
- metric settings- Returns:
- new instance of
Gauge
metric
-
createHistogram
- Specified by:
createHistogram
in interfaceMetricsService
- Parameters:
settings
- metric settings- Returns:
- new instance of
Histogram
metric
-
createInfo
- Specified by:
createInfo
in interfaceMetricsService
- Parameters:
settings
- metric settings- Returns:
- new instance of
Info
metric
-
closeMetric
Description copied from interface:MetricsService
Close instance of metric.Closed metric are no longer exported as part of snapshot. They will still be part of exposed metrics, but they are not stored in snapshot nor exported to external systems. Closed metric will be included in the nearest snapshot.
- Specified by:
closeMetric
in interfaceMetricsService
- Parameters:
metric
- metric to close. Must be metric created by the same instance ofMetricsService
-
snapshot
Description copied from interface:MetricsService
Gets snapshot state of metrics active in current moment.- Specified by:
snapshot
in interfaceMetricsService
- Returns:
- snapshot of metrics state in current moment
-
sample
Description copied from interface:MetricsService
Get last known state of all metrics in system.- Specified by:
sample
in interfaceMetricsService
- Returns:
- collection of last known samples of all metrics in system
-
resetMetrics
public void resetMetrics()
-