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 AtomicBoolean
connected
private AtomicReference<Duration>
lagBehindSource
private AtomicReference<String>
lastTransactionId
private static org.slf4j.Logger
LOGGER
private AtomicLong
numberOfCommittedTransactions
private 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 void
connected(boolean connected)
String[]
getCapturedTables()
String
getLastTransactionId()
long
getMilliSecondsBehindSource()
String[]
getMonitoredTables()
Deprecated.Superseded by the 'Captured Tables' metric.long
getNumberOfCommittedTransactions()
Map<String,String>
getSourceEventPosition()
boolean
isConnected()
void
onConnectorEvent(ConnectorEvent event)
Invoked for events that represent a connector event.void
onEvent(DataCollectionId source, OffsetContext offset, Object key, org.apache.kafka.connect.data.Struct value)
Invoked if an event is processed for a captured table.void
reset()
-
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:
isConnected
in interfaceStreamingChangeEventSourceMetricsMXBean
-
getMonitoredTables
@Deprecated public String[] getMonitoredTables()
Deprecated.Superseded by the 'Captured Tables' metric. UsegetCapturedTables()
. Scheduled for removal in a future release.- Specified by:
getMonitoredTables
in interfaceChangeEventSourceMetricsMXBean
-
getCapturedTables
public String[] getCapturedTables()
- Specified by:
getCapturedTables
in interfaceChangeEventSourceMetricsMXBean
-
connected
public void connected(boolean connected)
-
getSourceEventPosition
public Map<String,String> getSourceEventPosition()
- Specified by:
getSourceEventPosition
in interfaceStreamingChangeEventSourceMetricsMXBean
-
getMilliSecondsBehindSource
public long getMilliSecondsBehindSource()
- Specified by:
getMilliSecondsBehindSource
in interfaceStreamingChangeEventSourceMetricsMXBean
-
getNumberOfCommittedTransactions
public long getNumberOfCommittedTransactions()
- Specified by:
getNumberOfCommittedTransactions
in interfaceStreamingChangeEventSourceMetricsMXBean
-
onEvent
public void onEvent(DataCollectionId source, OffsetContext offset, Object key, org.apache.kafka.connect.data.Struct value)
Description copied from interface:DataChangeEventListener
Invoked if an event is processed for a captured table.- Specified by:
onEvent
in interfaceDataChangeEventListener
- Overrides:
onEvent
in classPipelineMetrics
-
onConnectorEvent
public void onConnectorEvent(ConnectorEvent event)
Description copied from interface:DataChangeEventListener
Invoked for events that represent a connector event.- Specified by:
onConnectorEvent
in interfaceDataChangeEventListener
- Overrides:
onConnectorEvent
in classPipelineMetrics
-
getLastTransactionId
public String getLastTransactionId()
- Specified by:
getLastTransactionId
in interfaceStreamingChangeEventSourceMetricsMXBean
-
reset
public void reset()
- Specified by:
reset
in interfaceChangeEventSourceMetricsMXBean
- Overrides:
reset
in classPipelineMetrics
-
-