Package io.debezium.pipeline.metrics
Class DefaultStreamingChangeEventSourceMetrics
- java.lang.Object
-
- io.debezium.metrics.Metrics
-
- io.debezium.pipeline.metrics.PipelineMetrics
-
- io.debezium.pipeline.metrics.DefaultStreamingChangeEventSourceMetrics
-
- All Implemented Interfaces:
ChangeEventSourceMetrics
,ChangeEventSourceMetricsMXBean
,StreamingChangeEventSourceMetrics
,StreamingChangeEventSourceMetricsMXBean
,DataChangeEventListener
,StreamingProgressListener
@ThreadSafe public class DefaultStreamingChangeEventSourceMetrics extends PipelineMetrics implements StreamingChangeEventSourceMetrics, StreamingChangeEventSourceMetricsMXBean
The default implementation of metrics related to the streaming phase of a connector.- 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, totalNumberOfCreateEventsSeen, totalNumberOfDeleteEventsSeen, totalNumberOfEventsSeen, totalNumberOfUpdateEventsSeen
-
Fields inherited from interface io.debezium.pipeline.source.spi.DataChangeEventListener
NO_OP
-
-
Constructor Summary
Constructors Constructor Description DefaultStreamingChangeEventSourceMetrics(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, Envelope.Operation operation)
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, getTotalNumberOfCreateEventsSeen, getTotalNumberOfDeleteEventsSeen, getTotalNumberOfEventsSeen, getTotalNumberOfUpdateEventsSeen, onErroneousEvent, onErroneousEvent, onFilteredEvent, 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.ChangeEventSourceMetrics
register, unregister
-
Methods inherited from interface io.debezium.pipeline.metrics.ChangeEventSourceMetricsMXBean
getCurrentQueueSizeInBytes, getLastEvent, getMaxQueueSizeInBytes, getMilliSecondsSinceLastEvent, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, getTotalNumberOfCreateEventsSeen, getTotalNumberOfDeleteEventsSeen, getTotalNumberOfEventsSeen, getTotalNumberOfUpdateEventsSeen
-
Methods inherited from interface io.debezium.pipeline.source.spi.DataChangeEventListener
onErroneousEvent, onErroneousEvent, onFilteredEvent, 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
-
DefaultStreamingChangeEventSourceMetrics
public DefaultStreamingChangeEventSourceMetrics(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)
- Specified by:
connected
in interfaceStreamingProgressListener
-
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, Envelope.Operation operation)
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
-
-