Package io.debezium.pipeline.metrics
Class SnapshotChangeEventSourceMetrics
- java.lang.Object
-
- io.debezium.metrics.Metrics
-
- io.debezium.pipeline.metrics.PipelineMetrics
-
- io.debezium.pipeline.metrics.SnapshotChangeEventSourceMetrics
-
- All Implemented Interfaces:
ChangeEventSourceMetricsMXBean,SnapshotChangeEventSourceMetricsMXBean,DataChangeEventListener,SnapshotProgressListener
@ThreadSafe public class SnapshotChangeEventSourceMetrics extends PipelineMetrics implements SnapshotChangeEventSourceMetricsMXBean, SnapshotProgressListener
Metrics related to the initial snapshot of a connector.- Author:
- Randall Hauch, Jiri Pechanec
-
-
Field Summary
Fields Modifier and Type Field Description private Set<String>capturedTablesprivate AtomicReference<Object[]>chunkFromprivate AtomicReference<String>chunkIdprivate AtomicReference<Object[]>chunkToprivate ConcurrentMap<String,String>remainingTablesprivate ConcurrentMap<String,Long>rowsScannedprivate AtomicBooleansnapshotAbortedprivate AtomicBooleansnapshotCompletedprivate AtomicBooleansnapshotRunningprivate AtomicLongstartTimeprivate AtomicLongstopTime-
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
-
Fields inherited from interface io.debezium.pipeline.source.spi.SnapshotProgressListener
NO_OP
-
-
Constructor Summary
Constructors Constructor Description SnapshotChangeEventSourceMetrics(T taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcurrentChunk(String chunkId, Object[] from, Object[] to)voiddataCollectionSnapshotCompleted(DataCollectionId dataCollectionId, long numRows)String[]getCapturedTables()StringgetChunkFrom()StringgetChunkId()StringgetChunkTo()String[]getMonitoredTables()Deprecated.Superseded by the 'Captured Tables' metric.intgetRemainingTableCount()ConcurrentMap<String,Long>getRowsScanned()booleangetSnapshotAborted()booleangetSnapshotCompleted()longgetSnapshotDurationInSeconds()booleangetSnapshotRunning()intgetTotalTableCount()voidmonitoredDataCollectionsDetermined(Iterable<? extends DataCollectionId> dataCollectionIds)voidreset()voidrowsScanned(TableId tableId, long numRows)voidsnapshotAborted()voidsnapshotCompleted()voidsnapshotStarted()-
Methods inherited from class io.debezium.pipeline.metrics.PipelineMetrics
getCurrentQueueSizeInBytes, getLastEvent, getMaxQueueSizeInBytes, getMilliSecondsSinceLastEvent, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, getTotalNumberOfEventsSeen, 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, getLastEvent, getMaxQueueSizeInBytes, getMilliSecondsSinceLastEvent, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, getTotalNumberOfEventsSeen
-
-
-
-
Field Detail
-
snapshotRunning
private final AtomicBoolean snapshotRunning
-
snapshotCompleted
private final AtomicBoolean snapshotCompleted
-
snapshotAborted
private final AtomicBoolean snapshotAborted
-
startTime
private final AtomicLong startTime
-
stopTime
private final AtomicLong stopTime
-
rowsScanned
private final ConcurrentMap<String,Long> rowsScanned
-
remainingTables
private final ConcurrentMap<String,String> remainingTables
-
chunkId
private final AtomicReference<String> chunkId
-
chunkFrom
private final AtomicReference<Object[]> chunkFrom
-
chunkTo
private final AtomicReference<Object[]> chunkTo
-
-
Constructor Detail
-
SnapshotChangeEventSourceMetrics
public SnapshotChangeEventSourceMetrics(T taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider)
-
-
Method Detail
-
getTotalTableCount
public int getTotalTableCount()
- Specified by:
getTotalTableCountin interfaceSnapshotChangeEventSourceMetricsMXBean
-
getRemainingTableCount
public int getRemainingTableCount()
- Specified by:
getRemainingTableCountin interfaceSnapshotChangeEventSourceMetricsMXBean
-
getSnapshotRunning
public boolean getSnapshotRunning()
- Specified by:
getSnapshotRunningin interfaceSnapshotChangeEventSourceMetricsMXBean
-
getSnapshotCompleted
public boolean getSnapshotCompleted()
- Specified by:
getSnapshotCompletedin interfaceSnapshotChangeEventSourceMetricsMXBean
-
getSnapshotAborted
public boolean getSnapshotAborted()
- Specified by:
getSnapshotAbortedin interfaceSnapshotChangeEventSourceMetricsMXBean
-
getSnapshotDurationInSeconds
public long getSnapshotDurationInSeconds()
- Specified by:
getSnapshotDurationInSecondsin interfaceSnapshotChangeEventSourceMetricsMXBean
-
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
-
monitoredDataCollectionsDetermined
public void monitoredDataCollectionsDetermined(Iterable<? extends DataCollectionId> dataCollectionIds)
- Specified by:
monitoredDataCollectionsDeterminedin interfaceSnapshotProgressListener
-
dataCollectionSnapshotCompleted
public void dataCollectionSnapshotCompleted(DataCollectionId dataCollectionId, long numRows)
- Specified by:
dataCollectionSnapshotCompletedin interfaceSnapshotProgressListener
-
snapshotStarted
public void snapshotStarted()
- Specified by:
snapshotStartedin interfaceSnapshotProgressListener
-
snapshotCompleted
public void snapshotCompleted()
- Specified by:
snapshotCompletedin interfaceSnapshotProgressListener
-
snapshotAborted
public void snapshotAborted()
- Specified by:
snapshotAbortedin interfaceSnapshotProgressListener
-
rowsScanned
public void rowsScanned(TableId tableId, long numRows)
- Specified by:
rowsScannedin interfaceSnapshotProgressListener
-
getRowsScanned
public ConcurrentMap<String,Long> getRowsScanned()
- Specified by:
getRowsScannedin interfaceSnapshotChangeEventSourceMetricsMXBean
-
currentChunk
public void currentChunk(String chunkId, Object[] from, Object[] to)
- Specified by:
currentChunkin interfaceSnapshotProgressListener
-
getChunkId
public String getChunkId()
- Specified by:
getChunkIdin interfaceSnapshotChangeEventSourceMetricsMXBean
-
getChunkFrom
public String getChunkFrom()
- Specified by:
getChunkFromin interfaceSnapshotChangeEventSourceMetricsMXBean
-
getChunkTo
public String getChunkTo()
- Specified by:
getChunkToin interfaceSnapshotChangeEventSourceMetricsMXBean
-
reset
public void reset()
- Specified by:
resetin interfaceChangeEventSourceMetricsMXBean- Overrides:
resetin classPipelineMetrics
-
-