Class BinlogStreamingChangeEventSourceMetrics<T extends BinlogDatabaseSchema,P extends Partition>
java.lang.Object
io.debezium.metrics.Metrics
io.debezium.pipeline.metrics.PipelineMetrics<P>
io.debezium.pipeline.metrics.DefaultStreamingChangeEventSourceMetrics<P>
io.debezium.connector.binlog.metrics.BinlogStreamingChangeEventSourceMetrics<T,P>
- All Implemented Interfaces:
BinlogStreamingChangeEventSourceMetricsMXBean,ChangeEventSourceMetrics<P>,ChangeEventSourceMetricsMXBean,StreamingChangeEventSourceMetrics<P>,StreamingChangeEventSourceMetricsMXBean,CommonEventMetricsMXBean,ConnectionMetricsMXBean,QueueMetricsMXBean,SchemaMetricsMXBean,StreamingMetricsMXBean,DataChangeEventListener<P>,StreamingProgressListener
public class BinlogStreamingChangeEventSourceMetrics<T extends BinlogDatabaseSchema,P extends Partition>
extends DefaultStreamingChangeEventSourceMetrics<P>
implements BinlogStreamingChangeEventSourceMetricsMXBean
Tracks the streaming metrics for binlog-based connectors.
- Author:
- Chris Cranford
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.github.shyiko.mysql.binlog.BinaryLogClientprivate final AtomicBooleanprivate final AtomicReference<String>private final AtomicLongprivate final AtomicLongprivate final AtomicLongprivate final AtomicLongprivate final AtomicLongprivate final Tprivate final com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatisticsFields inherited from class io.debezium.pipeline.metrics.PipelineMetrics
metadataProvider, taskContext -
Constructor Summary
ConstructorsConstructorDescriptionBinlogStreamingChangeEventSourceMetrics(BinlogTaskContext<T> taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider eventMetadataProvider) -
Method Summary
Modifier and TypeMethodDescriptionName of the current binlog file being read by underlying binlog client.longCurrent binlog offset position being read by underlying binlog client.String[]Current global transaction identifier (GTID) being read by underlying binlog client.booleanTracks if the connector is running using global transaction identifiers (GTID) to track current offset.longlonglongTracks the number of committed transactions.longTracks the number of times the underlying binlog client has been disconnected from the database.longTracks the number of transactions that contains events that had more entries than could be contained within the connectors binlog connector's instance.longTracks the number of transactions which are not well-formed.longTracks the number of rolled back transactions.longTracks the number of events skipped by underlying binlog client, generally due to the client being unable to properly deserialize the event.longbooleanvoidvoidonGtidChange(String gtid) voidvoidvoidvoidreset()voidsetIsGtidModeEnabled(boolean enabled) voidsetMilliSecondsBehindSource(long value) Methods inherited from class io.debezium.pipeline.metrics.DefaultStreamingChangeEventSourceMetrics
connected, onConnectorEvent, onEventMethods inherited from class io.debezium.pipeline.metrics.PipelineMetrics
getCurrentQueueSizeInBytes, getMaxQueueSizeInBytes, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, getTotalNumberOfCreateEventsSeen, getTotalNumberOfDeleteEventsSeen, getTotalNumberOfUpdateEventsSeen, onErroneousEvent, onErroneousEvent, onFilteredEvent, onFilteredEventMethods inherited from class io.debezium.metrics.Metrics
metricName, metricName, register, unregisterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.pipeline.metrics.ChangeEventSourceMetrics
register, unregisterMethods inherited from interface io.debezium.pipeline.metrics.traits.CommonEventMetricsMXBean
getNumberOfErroneousEvents, getNumberOfEventsFiltered, getTotalNumberOfCreateEventsSeen, getTotalNumberOfDeleteEventsSeen, getTotalNumberOfUpdateEventsSeenMethods inherited from interface io.debezium.pipeline.source.spi.DataChangeEventListener
onErroneousEvent, onErroneousEvent, onFilteredEvent, onFilteredEventMethods inherited from interface io.debezium.pipeline.metrics.traits.QueueMetricsMXBean
getCurrentQueueSizeInBytes, getMaxQueueSizeInBytes, getQueueRemainingCapacity, getQueueTotalCapacity
-
Field Details
-
client
private final com.github.shyiko.mysql.binlog.BinaryLogClient client -
stats
private final com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatistics stats -
schema
-
numberOfCommittedTransactions
-
numberOfRolledBackTransactions
-
numberOfNotWellFormedTransactions
-
numberOfLargeTransactions
-
isGtidModeEnabled
-
milliSecondsBehindMaster
-
lastTransactionId
-
-
Constructor Details
-
BinlogStreamingChangeEventSourceMetrics
public BinlogStreamingChangeEventSourceMetrics(BinlogTaskContext<T> taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider eventMetadataProvider)
-
-
Method Details
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceConnectionMetricsMXBean- Overrides:
isConnectedin classDefaultStreamingChangeEventSourceMetrics<P extends Partition>
-
getBinlogFilename
Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanName of the current binlog file being read by underlying binlog client.- Specified by:
getBinlogFilenamein interfaceBinlogStreamingChangeEventSourceMetricsMXBean
-
getBinlogPosition
public long getBinlogPosition()Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanCurrent binlog offset position being read by underlying binlog client.- Specified by:
getBinlogPositionin interfaceBinlogStreamingChangeEventSourceMetricsMXBean
-
getGtidSet
Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanCurrent global transaction identifier (GTID) being read by underlying binlog client.- Specified by:
getGtidSetin interfaceBinlogStreamingChangeEventSourceMetricsMXBean
-
getIsGtidModeEnabled
public boolean getIsGtidModeEnabled()Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanTracks if the connector is running using global transaction identifiers (GTID) to track current offset.- Specified by:
getIsGtidModeEnabledin interfaceBinlogStreamingChangeEventSourceMetricsMXBean- Returns:
- true if using global transaction identifiers, false if not.
-
getLastEvent
- Specified by:
getLastEventin interfaceCommonEventMetricsMXBean- Overrides:
getLastEventin classPipelineMetrics<P extends Partition>
-
getMilliSecondsSinceLastEvent
public long getMilliSecondsSinceLastEvent()- Specified by:
getMilliSecondsSinceLastEventin interfaceCommonEventMetricsMXBean- Overrides:
getMilliSecondsSinceLastEventin classPipelineMetrics<P extends Partition>
-
getTotalNumberOfEventsSeen
public long getTotalNumberOfEventsSeen()- Specified by:
getTotalNumberOfEventsSeenin interfaceCommonEventMetricsMXBean- Overrides:
getTotalNumberOfEventsSeenin classPipelineMetrics<P extends Partition>
-
getNumberOfSkippedEvents
public long getNumberOfSkippedEvents()Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanTracks the number of events skipped by underlying binlog client, generally due to the client being unable to properly deserialize the event.- Specified by:
getNumberOfSkippedEventsin interfaceBinlogStreamingChangeEventSourceMetricsMXBean
-
getNumberOfDisconnects
public long getNumberOfDisconnects()Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanTracks the number of times the underlying binlog client has been disconnected from the database.- Specified by:
getNumberOfDisconnectsin interfaceBinlogStreamingChangeEventSourceMetricsMXBean
-
reset
public void reset()- Specified by:
resetin interfaceChangeEventSourceMetricsMXBean- Overrides:
resetin classDefaultStreamingChangeEventSourceMetrics<P extends Partition>
-
getNumberOfCommittedTransactions
public long getNumberOfCommittedTransactions()Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanTracks the number of committed transactions.- Specified by:
getNumberOfCommittedTransactionsin interfaceBinlogStreamingChangeEventSourceMetricsMXBean- Specified by:
getNumberOfCommittedTransactionsin interfaceStreamingMetricsMXBean- Overrides:
getNumberOfCommittedTransactionsin classDefaultStreamingChangeEventSourceMetrics<P extends Partition>
-
getNumberOfRolledBackTransactions
public long getNumberOfRolledBackTransactions()Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanTracks the number of rolled back transactions.- Specified by:
getNumberOfRolledBackTransactionsin interfaceBinlogStreamingChangeEventSourceMetricsMXBean
-
getNumberOfNotWellFormedTransactions
public long getNumberOfNotWellFormedTransactions()Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanTracks the number of transactions which are not well-formed. Example - The connector sees a commit-transaction event without a matching begin-transaction event.- Specified by:
getNumberOfNotWellFormedTransactionsin interfaceBinlogStreamingChangeEventSourceMetricsMXBean
-
getNumberOfLargeTransactions
public long getNumberOfLargeTransactions()Description copied from interface:BinlogStreamingChangeEventSourceMetricsMXBeanTracks the number of transactions that contains events that had more entries than could be contained within the connectors binlog connector's instance.- Specified by:
getNumberOfLargeTransactionsin interfaceBinlogStreamingChangeEventSourceMetricsMXBean
-
getCapturedTables
- Specified by:
getCapturedTablesin interfaceSchemaMetricsMXBean- Overrides:
getCapturedTablesin classDefaultStreamingChangeEventSourceMetrics<P extends Partition>
-
getMilliSecondsBehindSource
public long getMilliSecondsBehindSource()- Specified by:
getMilliSecondsBehindSourcein interfaceStreamingMetricsMXBean- Overrides:
getMilliSecondsBehindSourcein classDefaultStreamingChangeEventSourceMetrics<P extends Partition>
-
getSourceEventPosition
- Specified by:
getSourceEventPositionin interfaceStreamingMetricsMXBean- Overrides:
getSourceEventPositionin classDefaultStreamingChangeEventSourceMetrics<P extends Partition>
-
getLastTransactionId
- Specified by:
getLastTransactionIdin interfaceStreamingMetricsMXBean- Overrides:
getLastTransactionIdin classDefaultStreamingChangeEventSourceMetrics<P extends Partition>
-
onCommittedTransaction
public void onCommittedTransaction() -
onRolledBackTransaction
public void onRolledBackTransaction() -
onNotWellFormedTransaction
public void onNotWellFormedTransaction() -
onLargeTransaction
public void onLargeTransaction() -
onGtidChange
-
setIsGtidModeEnabled
public void setIsGtidModeEnabled(boolean enabled) -
setMilliSecondsBehindSource
public void setMilliSecondsBehindSource(long value)
-