Package io.debezium.metrics
Class Metrics
- java.lang.Object
-
- io.debezium.metrics.Metrics
-
- Direct Known Subclasses:
DatabaseHistoryMetrics
,PipelineMetrics
@ThreadSafe public abstract class Metrics extends Object
Base for metrics implementations.- Author:
- Jiri Pechanec
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOGGER
private ObjectName
name
private boolean
registered
-
Constructor Summary
Constructors Modifier Constructor Description protected
Metrics(CommonConnectorConfig connectorConfig, String contextName, boolean multiPartitionMode)
protected
Metrics(CdcSourceTaskContext taskContext, String contextName)
protected
Metrics(CdcSourceTaskContext taskContext, Map<String,String> tags)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectName
metricName(String connectorType, String connectorName, String contextName)
protected ObjectName
metricName(String connectorType, Map<String,String> tags)
Create a JMX metric name for the given metric.void
register()
Registers a metrics MBean into the platform MBean server.void
unregister()
Unregisters a metrics MBean from the platform MBean server.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
name
private final ObjectName name
-
registered
private volatile boolean registered
-
-
Constructor Detail
-
Metrics
protected Metrics(CdcSourceTaskContext taskContext, String contextName)
-
Metrics
protected Metrics(CdcSourceTaskContext taskContext, Map<String,String> tags)
-
Metrics
protected Metrics(CommonConnectorConfig connectorConfig, String contextName, boolean multiPartitionMode)
-
-
Method Detail
-
register
public void register()
Registers a metrics MBean into the platform MBean server. The method is intentionally synchronized to prevent preemption between registration and unregistration.
-
unregister
public void unregister()
Unregisters a metrics MBean from the platform MBean server. The method is intentionally synchronized to prevent preemption between registration and unregistration.
-
metricName
protected ObjectName metricName(String connectorType, String connectorName, String contextName)
-
metricName
protected ObjectName metricName(String connectorType, Map<String,String> tags)
Create a JMX metric name for the given metric.- Returns:
- the JMX metric name
-
-