Class PrometheusHistogramMetricsTrackerFactory
- java.lang.Object
-
- com.zaxxer.hikari.metrics.prometheus.PrometheusHistogramMetricsTrackerFactory
-
- All Implemented Interfaces:
MetricsTrackerFactory
public class PrometheusHistogramMetricsTrackerFactory extends Object implements MetricsTrackerFactory
HikariConfig config = new HikariConfig(); config.setMetricsTrackerFactory(new PrometheusHistogramMetricsTrackerFactory());
-
-
Constructor Summary
Constructors Constructor Description PrometheusHistogramMetricsTrackerFactory()Default Constructor.PrometheusHistogramMetricsTrackerFactory(io.prometheus.client.CollectorRegistry collectorRegistry)Constructor that allows to pass in aCollectorRegistryto which the Hikari metrics are registered.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IMetricsTrackercreate(String poolName, PoolStats poolStats)Create an instance of an IMetricsTracker.
-
-
-
Constructor Detail
-
PrometheusHistogramMetricsTrackerFactory
public PrometheusHistogramMetricsTrackerFactory()
Default Constructor. The Hikari metrics are registered to the default collector registry (CollectorRegistry.defaultRegistry).
-
PrometheusHistogramMetricsTrackerFactory
public PrometheusHistogramMetricsTrackerFactory(io.prometheus.client.CollectorRegistry collectorRegistry)
Constructor that allows to pass in aCollectorRegistryto which the Hikari metrics are registered.- Parameters:
collectorRegistry- the collector registry to register the metrics to
-
-
Method Detail
-
create
public IMetricsTracker create(String poolName, PoolStats poolStats)
Description copied from interface:MetricsTrackerFactoryCreate an instance of an IMetricsTracker.- Specified by:
createin interfaceMetricsTrackerFactory- Parameters:
poolName- the name of the poolpoolStats- a PoolStats instance to use- Returns:
- a IMetricsTracker implementation instance
-
-