Class BinlogReaderMetrics
- java.lang.Object
-
- io.debezium.metrics.Metrics
-
- io.debezium.pipeline.metrics.PipelineMetrics
-
- io.debezium.connector.mysql.legacy.BinlogReaderMetrics
-
- All Implemented Interfaces:
BinlogReaderMetricsMXBean,ChangeEventSourceMetricsMXBean,StreamingChangeEventSourceMetricsMXBean,DataChangeEventListener
public class BinlogReaderMetrics extends PipelineMetrics implements BinlogReaderMetricsMXBean
- Author:
- Randall Hauch
-
-
Field Summary
Fields Modifier and Type Field Description private com.github.shyiko.mysql.binlog.BinaryLogClientclientprivate AtomicBooleanisGtidModeEnabledprivate AtomicReference<String>lastTransactionIdprivate AtomicLongmilliSecondsBehindMasterprivate AtomicLongnumberOfCommittedTransactionsprivate AtomicLongnumberOfLargeTransactionsprivate AtomicLongnumberOfNotWellFormedTransactionsprivate AtomicLongnumberOfRolledBackTransactionsprivate MySqlSchemaschemaprivate com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatisticsstats-
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 BinlogReaderMetrics(com.github.shyiko.mysql.binlog.BinaryLogClient client, MySqlTaskContext taskContext, String name, ChangeEventQueueMetrics changeEventQueueMetrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetBinlogFilename()Name of the current MySQL binlog file being read by underlying mysql-binlog-client.longgetBinlogPosition()Current MySQL binlog offset position being read by underlying mysql-binlog-client.String[]getCapturedTables()StringgetGtidSet()Current MySQL Gtid being read by underlying mysql-binlog-client.booleangetIsGtidModeEnabled()Tracks if the connector is running using Gtids to track current offset.StringgetLastEvent()StringgetLastTransactionId()longgetMilliSecondsBehindSource()longgetMilliSecondsSinceLastEvent()String[]getMonitoredTables()Deprecated.Superseded by the 'Captured Tables' metric.longgetNumberOfCommittedTransactions()Tracks the number of committed transactions.longgetNumberOfDisconnects()Tracks the number of times the underlying mysql-binlog-client has been disconnected from MySQL.longgetNumberOfLargeTransactions()Tracks the number of transaction which contains events that contained more entries than could be contained within the connectors {@see io.debezium.connector.mysql.EventBuffer} instance.longgetNumberOfNotWellFormedTransactions()Tracks the number of transactions which are not well-formed.longgetNumberOfRolledBackTransactions()Tracks the number of rolled back transactions.longgetNumberOfSkippedEvents()Tracks the number of events skipped by underlying mysql-binlog-client, generally due to the client being unable to properly deserialize the event.Map<String,String>getSourceEventPosition()longgetTotalNumberOfEventsSeen()booleanisConnected()voidonCommittedTransaction()voidonGtidChange(String gtid)voidonLargeTransaction()voidonNotWellFormedTransaction()voidonRolledBackTransaction()voidreset()voidsetIsGtidModeEnabled(boolean enabled)voidsetMilliSecondsBehindSource(long value)-
Methods inherited from class io.debezium.pipeline.metrics.PipelineMetrics
getCurrentQueueSizeInBytes, getMaxQueueSizeInBytes, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, onConnectorEvent, onErroneousEvent, onEvent, 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, getMaxQueueSizeInBytes, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity
-
-
-
-
Field Detail
-
client
private final com.github.shyiko.mysql.binlog.BinaryLogClient client
-
stats
private final com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatistics stats
-
schema
private final MySqlSchema schema
-
numberOfCommittedTransactions
private final AtomicLong numberOfCommittedTransactions
-
numberOfRolledBackTransactions
private final AtomicLong numberOfRolledBackTransactions
-
numberOfNotWellFormedTransactions
private final AtomicLong numberOfNotWellFormedTransactions
-
numberOfLargeTransactions
private final AtomicLong numberOfLargeTransactions
-
isGtidModeEnabled
private final AtomicBoolean isGtidModeEnabled
-
milliSecondsBehindMaster
private final AtomicLong milliSecondsBehindMaster
-
lastTransactionId
private final AtomicReference<String> lastTransactionId
-
-
Constructor Detail
-
BinlogReaderMetrics
public BinlogReaderMetrics(com.github.shyiko.mysql.binlog.BinaryLogClient client, MySqlTaskContext taskContext, String name, ChangeEventQueueMetrics changeEventQueueMetrics)
-
-
Method Detail
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceStreamingChangeEventSourceMetricsMXBean
-
getBinlogFilename
public String getBinlogFilename()
Description copied from interface:BinlogReaderMetricsMXBeanName of the current MySQL binlog file being read by underlying mysql-binlog-client.- Specified by:
getBinlogFilenamein interfaceBinlogReaderMetricsMXBean
-
getBinlogPosition
public long getBinlogPosition()
Description copied from interface:BinlogReaderMetricsMXBeanCurrent MySQL binlog offset position being read by underlying mysql-binlog-client.- Specified by:
getBinlogPositionin interfaceBinlogReaderMetricsMXBean
-
getGtidSet
public String getGtidSet()
Description copied from interface:BinlogReaderMetricsMXBeanCurrent MySQL Gtid being read by underlying mysql-binlog-client.- Specified by:
getGtidSetin interfaceBinlogReaderMetricsMXBean
-
getIsGtidModeEnabled
public boolean getIsGtidModeEnabled()
Description copied from interface:BinlogReaderMetricsMXBeanTracks if the connector is running using Gtids to track current offset.- Specified by:
getIsGtidModeEnabledin interfaceBinlogReaderMetricsMXBean- Returns:
- true if using Gtids, false if not.
-
getLastEvent
public String getLastEvent()
- Specified by:
getLastEventin interfaceChangeEventSourceMetricsMXBean- Overrides:
getLastEventin classPipelineMetrics
-
getMilliSecondsSinceLastEvent
public long getMilliSecondsSinceLastEvent()
- Specified by:
getMilliSecondsSinceLastEventin interfaceChangeEventSourceMetricsMXBean- Overrides:
getMilliSecondsSinceLastEventin classPipelineMetrics
-
getTotalNumberOfEventsSeen
public long getTotalNumberOfEventsSeen()
- Specified by:
getTotalNumberOfEventsSeenin interfaceChangeEventSourceMetricsMXBean- Overrides:
getTotalNumberOfEventsSeenin classPipelineMetrics
-
getNumberOfSkippedEvents
public long getNumberOfSkippedEvents()
Description copied from interface:BinlogReaderMetricsMXBeanTracks the number of events skipped by underlying mysql-binlog-client, generally due to the client being unable to properly deserialize the event.- Specified by:
getNumberOfSkippedEventsin interfaceBinlogReaderMetricsMXBean
-
getNumberOfDisconnects
public long getNumberOfDisconnects()
Description copied from interface:BinlogReaderMetricsMXBeanTracks the number of times the underlying mysql-binlog-client has been disconnected from MySQL.- Specified by:
getNumberOfDisconnectsin interfaceBinlogReaderMetricsMXBean
-
reset
public void reset()
- Specified by:
resetin interfaceChangeEventSourceMetricsMXBean- Overrides:
resetin classPipelineMetrics
-
getNumberOfCommittedTransactions
public long getNumberOfCommittedTransactions()
Description copied from interface:BinlogReaderMetricsMXBeanTracks the number of committed transactions.- Specified by:
getNumberOfCommittedTransactionsin interfaceBinlogReaderMetricsMXBean- Specified by:
getNumberOfCommittedTransactionsin interfaceStreamingChangeEventSourceMetricsMXBean
-
getNumberOfRolledBackTransactions
public long getNumberOfRolledBackTransactions()
Description copied from interface:BinlogReaderMetricsMXBeanTracks the number of rolled back transactions.- Specified by:
getNumberOfRolledBackTransactionsin interfaceBinlogReaderMetricsMXBean
-
getNumberOfNotWellFormedTransactions
public long getNumberOfNotWellFormedTransactions()
Description copied from interface:BinlogReaderMetricsMXBeanTracks the number of transactions which are not well-formed. Example - The connector sees a commit TX event without a matched begin TX event.- Specified by:
getNumberOfNotWellFormedTransactionsin interfaceBinlogReaderMetricsMXBean
-
getNumberOfLargeTransactions
public long getNumberOfLargeTransactions()
Description copied from interface:BinlogReaderMetricsMXBeanTracks the number of transaction which contains events that contained more entries than could be contained within the connectors {@see io.debezium.connector.mysql.EventBuffer} instance.- Specified by:
getNumberOfLargeTransactionsin interfaceBinlogReaderMetricsMXBean
-
onCommittedTransaction
public void onCommittedTransaction()
-
onRolledBackTransaction
public void onRolledBackTransaction()
-
onNotWellFormedTransaction
public void onNotWellFormedTransaction()
-
onLargeTransaction
public void onLargeTransaction()
-
onGtidChange
public void onGtidChange(String gtid)
-
setIsGtidModeEnabled
public void setIsGtidModeEnabled(boolean enabled)
-
setMilliSecondsBehindSource
public void setMilliSecondsBehindSource(long value)
-
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
-
getMilliSecondsBehindSource
public long getMilliSecondsBehindSource()
- Specified by:
getMilliSecondsBehindSourcein interfaceStreamingChangeEventSourceMetricsMXBean
-
getSourceEventPosition
public Map<String,String> getSourceEventPosition()
- Specified by:
getSourceEventPositionin interfaceStreamingChangeEventSourceMetricsMXBean
-
getLastTransactionId
public String getLastTransactionId()
- Specified by:
getLastTransactionIdin interfaceStreamingChangeEventSourceMetricsMXBean
-
-