Package io.debezium.relational.history
Class SchemaHistoryMetrics
java.lang.Object
io.debezium.metrics.Metrics
io.debezium.relational.history.SchemaHistoryMetrics
- All Implemented Interfaces:
SchemaHistoryListener,SchemaHistoryMXBean
public class SchemaHistoryMetrics
extends Metrics
implements SchemaHistoryListener, SchemaHistoryMXBean
Implementation of
DatabaseSchema metrics.- Author:
- Jiri Pechanec
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AtomicLongprivate final Clockprivate static final Stringprivate HistoryRecordprivate final ElapsedTimeStrategyprivate Instantprivate final ElapsedTimeStrategyprivate Instantprivate HistoryRecordprivate static final org.slf4j.Loggerprivate static final Durationprivate Instantprivate AtomicLongFields inherited from interface io.debezium.relational.history.SchemaHistoryListener
NOOP -
Constructor Summary
ConstructorsConstructorDescriptionSchemaHistoryMetrics(CommonConnectorConfig connectorConfig, boolean multiPartitionMode) -
Method Summary
Modifier and TypeMethodDescriptionlonglonglonglonglongThe schema history starts inSTOPPEDstate.voidonChangeApplied(HistoryRecord record) Invoked for every change applied and not filtered.voidonChangeFromHistory(HistoryRecord record) Invoked for every change read from the history during recovery.voidvoidvoidstarted()voidstopped()Methods inherited from class io.debezium.metrics.Metrics
metricName, metricName, register, unregister
-
Field Details
-
CONTEXT_NAME
- See Also:
-
PAUSE_BETWEEN_LOG_MESSAGES
-
LOGGER
private static final org.slf4j.Logger LOGGER -
status
-
recoveryStartTime
-
changesRecovered
-
totalChangesApplied
-
lastChangeAppliedTimestamp
-
lastChangeRecoveredTimestamp
-
lastAppliedChange
-
lastRecoveredChange
-
clock
-
lastChangeAppliedLogDelay
-
lastChangeRecoveredLogDelay
-
-
Constructor Details
-
SchemaHistoryMetrics
-
-
Method Details
-
getStatus
Description copied from interface:SchemaHistoryMXBeanThe schema history starts inSTOPPEDstate. Upon start it transitions toRECOVERINGstate. When all changes from stored history were applied then it switches toRUNNINGstate.Maps to
SchemaHistoryMetrics.SchemaHistoryStatusenum.- Specified by:
getStatusin interfaceSchemaHistoryMXBean- Returns:
- schema history component state
-
getRecoveryStartTime
public long getRecoveryStartTime()- Specified by:
getRecoveryStartTimein interfaceSchemaHistoryMXBean- Returns:
- time in epoch seconds when recovery has started
-
getChangesRecovered
public long getChangesRecovered()- Specified by:
getChangesRecoveredin interfaceSchemaHistoryMXBean- Returns:
- number of changes that were read during recovery phase
-
getChangesApplied
public long getChangesApplied()- Specified by:
getChangesAppliedin interfaceSchemaHistoryMXBean- Returns:
- number of changes that were applied during recovery phase increased by number of changes applied during runtime
-
getMilliSecondsSinceLastAppliedChange
public long getMilliSecondsSinceLastAppliedChange()- Specified by:
getMilliSecondsSinceLastAppliedChangein interfaceSchemaHistoryMXBean- Returns:
- elapsed time in milliseconds since the last change was applied
-
getMilliSecondsSinceLastRecoveredChange
public long getMilliSecondsSinceLastRecoveredChange()- Specified by:
getMilliSecondsSinceLastRecoveredChangein interfaceSchemaHistoryMXBean- Returns:
- elapsed time in milliseconds since the last record was recovered from history
-
getLastAppliedChange
- Specified by:
getLastAppliedChangein interfaceSchemaHistoryMXBean- Returns:
- String representation of the last applied change
-
getLastRecoveredChange
- Specified by:
getLastRecoveredChangein interfaceSchemaHistoryMXBean- Returns:
- String representation of the last recovered change
-
started
public void started()- Specified by:
startedin interfaceSchemaHistoryListener
-
stopped
public void stopped()- Specified by:
stoppedin interfaceSchemaHistoryListener
-
recoveryStarted
public void recoveryStarted()- Specified by:
recoveryStartedin interfaceSchemaHistoryListener
-
recoveryStopped
public void recoveryStopped()- Specified by:
recoveryStoppedin interfaceSchemaHistoryListener
-
onChangeFromHistory
Description copied from interface:SchemaHistoryListenerInvoked for every change read from the history during recovery.- Specified by:
onChangeFromHistoryin interfaceSchemaHistoryListener
-
onChangeApplied
Description copied from interface:SchemaHistoryListenerInvoked for every change applied and not filtered.- Specified by:
onChangeAppliedin interfaceSchemaHistoryListener
-