Package io.debezium.pipeline.metrics
Class StreamingChangeEventSourceMetrics
- java.lang.Object
-
- io.debezium.metrics.Metrics
-
- io.debezium.pipeline.metrics.PipelineMetrics
-
- io.debezium.pipeline.metrics.StreamingChangeEventSourceMetrics
-
- All Implemented Interfaces:
ChangeEventSourceMetricsMXBean,StreamingChangeEventSourceMetricsMXBean,DataChangeEventListener
@ThreadSafe public class StreamingChangeEventSourceMetrics extends PipelineMetrics implements StreamingChangeEventSourceMetricsMXBean, DataChangeEventListener
- Author:
- Randall Hauch, Jiri Pechanec
-
-
Field Summary
Fields Modifier and Type Field Description private AtomicBooleanconnectedprivate AtomicReference<Duration>lagBehindSourceprivate AtomicReference<String>lastTransactionIdprivate static org.slf4j.LoggerLOGGERprivate AtomicLongnumberOfCommittedTransactionsprivate AtomicReference<Map<String,String>>sourceEventPosition-
Fields inherited from class io.debezium.pipeline.metrics.PipelineMetrics
clock, lastEventTimestamp, metadataProvider, numberOfErroneousEvents, taskContext, totalNumberOfEventsSeen
-
Fields inherited from interface io.debezium.pipeline.source.spi.DataChangeEventListener
NO_OP
-
-
Constructor Summary
Constructors Constructor Description StreamingChangeEventSourceMetrics(T taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidconnected(boolean connected)String[]getCapturedTables()StringgetLastTransactionId()longgetMilliSecondsBehindSource()String[]getMonitoredTables()Deprecated.Superseded by the 'Captured Tables' metric.longgetNumberOfCommittedTransactions()Map<String,String>getSourceEventPosition()booleanisConnected()voidonConnectorEvent(ConnectorEvent event)Invoked for events that represent a connector event.voidonEvent(DataCollectionId source, OffsetContext offset, Object key, org.apache.kafka.connect.data.Struct value)Invoked if an event is processed for a captured table.voidreset()-
Methods inherited from class io.debezium.pipeline.metrics.PipelineMetrics
getCurrentQueueSizeInBytes, getLastEvent, getMaxQueueSizeInBytes, getMilliSecondsSinceLastEvent, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, getTotalNumberOfEventsSeen, onErroneousEvent, onFilteredEvent
-
Methods inherited from class io.debezium.metrics.Metrics
metricName, register, unregister
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.debezium.pipeline.metrics.ChangeEventSourceMetricsMXBean
getCurrentQueueSizeInBytes, getLastEvent, getMaxQueueSizeInBytes, getMilliSecondsSinceLastEvent, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, getTotalNumberOfEventsSeen
-
Methods inherited from interface io.debezium.pipeline.source.spi.DataChangeEventListener
onErroneousEvent, onFilteredEvent
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
connected
private final AtomicBoolean connected
-
lagBehindSource
private final AtomicReference<Duration> lagBehindSource
-
numberOfCommittedTransactions
private final AtomicLong numberOfCommittedTransactions
-
sourceEventPosition
private final AtomicReference<Map<String,String>> sourceEventPosition
-
lastTransactionId
private final AtomicReference<String> lastTransactionId
-
-
Constructor Detail
-
StreamingChangeEventSourceMetrics
public StreamingChangeEventSourceMetrics(T taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider)
-
-
Method Detail
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceStreamingChangeEventSourceMetricsMXBean
-
getMonitoredTables
@Deprecated public String[] getMonitoredTables()
Deprecated.Superseded by the 'Captured Tables' metric. UsegetCapturedTables(). Scheduled for removal in a future release.- Specified by:
getMonitoredTablesin interfaceChangeEventSourceMetricsMXBean
-
getCapturedTables
public String[] getCapturedTables()
- Specified by:
getCapturedTablesin interfaceChangeEventSourceMetricsMXBean
-
connected
public void connected(boolean connected)
-
getSourceEventPosition
public Map<String,String> getSourceEventPosition()
- Specified by:
getSourceEventPositionin interfaceStreamingChangeEventSourceMetricsMXBean
-
getMilliSecondsBehindSource
public long getMilliSecondsBehindSource()
- Specified by:
getMilliSecondsBehindSourcein interfaceStreamingChangeEventSourceMetricsMXBean
-
getNumberOfCommittedTransactions
public long getNumberOfCommittedTransactions()
- Specified by:
getNumberOfCommittedTransactionsin interfaceStreamingChangeEventSourceMetricsMXBean
-
onEvent
public void onEvent(DataCollectionId source, OffsetContext offset, Object key, org.apache.kafka.connect.data.Struct value)
Description copied from interface:DataChangeEventListenerInvoked if an event is processed for a captured table.- Specified by:
onEventin interfaceDataChangeEventListener- Overrides:
onEventin classPipelineMetrics
-
onConnectorEvent
public void onConnectorEvent(ConnectorEvent event)
Description copied from interface:DataChangeEventListenerInvoked for events that represent a connector event.- Specified by:
onConnectorEventin interfaceDataChangeEventListener- Overrides:
onConnectorEventin classPipelineMetrics
-
getLastTransactionId
public String getLastTransactionId()
- Specified by:
getLastTransactionIdin interfaceStreamingChangeEventSourceMetricsMXBean
-
reset
public void reset()
- Specified by:
resetin interfaceChangeEventSourceMetricsMXBean- Overrides:
resetin classPipelineMetrics
-
-