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 ObjectName
name
private boolean
registered
-
Constructor Summary
Constructors Modifier Constructor Description protected
Metrics(CommonConnectorConfig connectorConfig, String contextName)
protected
Metrics(CdcSourceTaskContext taskContext, String contextName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectName
metricName(String connectorType, String connectorName, String contextName)
Create a JMX metric name for the given metric.void
register(org.slf4j.Logger logger)
Registers a metrics MBean into the platform MBean server.void
unregister(org.slf4j.Logger logger)
Unregisters a metrics MBean from the platform MBean server.
-
-
-
Field Detail
-
name
private final ObjectName name
-
registered
private volatile boolean registered
-
-
Constructor Detail
-
Metrics
protected Metrics(CdcSourceTaskContext taskContext, String contextName)
-
Metrics
protected Metrics(CommonConnectorConfig connectorConfig, String contextName)
-
-
Method Detail
-
register
public void register(org.slf4j.Logger logger)
Registers a metrics MBean into the platform MBean server. The method is intentionally synchronized to prevent preemption between registration and unregistration.
-
unregister
public final void unregister(org.slf4j.Logger logger)
Unregisters a metrics MBean from the platform MBean server. The method is intentionally synchronized to prevent preemption between registration and unregistration.
-
metricName
public ObjectName metricName(String connectorType, String connectorName, String contextName)
Create a JMX metric name for the given metric.- Parameters:
contextName
- the name of the context- Returns:
- the JMX metric name
- Throws:
MalformedObjectNameException
- if the name is invalid
-
-