Class ChangeStreamMetrics
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.ChangeStreamMetrics
-
- All Implemented Interfaces:
java.io.Serializable
public class ChangeStreamMetrics extends java.lang.Object implements java.io.SerializableClass to aggregate metrics related functionality.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.beam.sdk.metrics.CounterACTIVE_PARTITION_READ_COUNTCounter for the active partition reads during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterDATA_RECORD_COMMITTED_TO_EMITTED_0MS_TO_1000MS_COUNTCounter for record latencies [0, 1000) ms during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterDATA_RECORD_COMMITTED_TO_EMITTED_1000MS_TO_3000MS_COUNTCounter for record latencies [1000, 3000) ms during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterDATA_RECORD_COMMITTED_TO_EMITTED_3000MS_TO_INF_COUNTCounter for record latencies equal or above 3000ms during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterDATA_RECORD_COUNTCounter for the total number of data records identified during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterHEARTBEAT_RECORD_COUNTCounter for the total number of heartbeat records identified during the execution of the Connector.static org.apache.beam.sdk.metrics.DistributionPARTITION_CREATED_TO_SCHEDULED_MSTime in milliseconds that a partition took to transition fromPartitionMetadata.State.CREATEDtoPartitionMetadata.State.SCHEDULED.static org.apache.beam.sdk.metrics.CounterPARTITION_END_RECORD_COUNTCounter for the total number of partition end records identified during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterPARTITION_EVENT_RECORD_COUNTCounter for the total number of partition event records identified during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterPARTITION_RECORD_COUNTCounter for the total number of partitions identified during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterPARTITION_RECORD_MERGE_COUNTCounter for the total number of partition merges identified during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterPARTITION_RECORD_SPLIT_COUNTCounter for the total number of partition splits / moves identified during the execution of the Connector.static org.apache.beam.sdk.metrics.DistributionPARTITION_SCHEDULED_TO_RUNNING_MSTime in milliseconds that a partition took to transition fromPartitionMetadata.State.SCHEDULEDtoPartitionMetadata.State.RUNNING.static org.apache.beam.sdk.metrics.CounterPARTITION_START_RECORD_COUNTCounter for the total number of partition start records identified during the execution of the Connector.static org.apache.beam.sdk.metrics.CounterQUERY_COUNTCounter for the total number of queries issued during the execution of the Connector.
-
Constructor Summary
Constructors Constructor Description ChangeStreamMetrics()Constructs a ChangeStreamMetrics instance with the following metrics enabled by default.ChangeStreamMetrics(java.util.Set<org.apache.beam.sdk.metrics.MetricName> enabledMetrics)Constructs a ChangeStreamMetrics instance with the given metrics enabled.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecActivePartitionReadCounter()Decrements theACTIVE_PARTITION_READ_COUNTby 1 if the metric is enabled.voidincActivePartitionReadCounter()Increments theACTIVE_PARTITION_READ_COUNTby 1 if the metric is enabled.voidincDataRecordCounter()Increments theDATA_RECORD_COUNTby 1 if the metric is enabled.voidincHeartbeatRecordCount()Increments theHEARTBEAT_RECORD_COUNTby 1 if the metric is enabled.voidincPartitionEndRecordCount()Increments thePARTITION_END_RECORD_COUNTby 1 if the metric is enabled.voidincPartitionEventRecordCount()Increments thePARTITION_END_RECORD_COUNTby 1 if the metric is enabled.voidincPartitionRecordCount()Increments thePARTITION_RECORD_COUNTby 1 if the metric is enabled.voidincPartitionRecordMergeCount()Increments thePARTITION_RECORD_MERGE_COUNTby 1 if the metric is enabled.voidincPartitionRecordSplitCount()Increments thePARTITION_RECORD_SPLIT_COUNTby 1 if the metric is enabled.voidincPartitionStartRecordCount()Increments thePARTITION_START_RECORD_COUNTby 1 if the metric is enabled.voidincQueryCounter()Increments theQUERY_COUNTby 1 if the metric is enabled.voidupdateDataRecordCommittedToEmitted(org.joda.time.Duration duration)voidupdatePartitionCreatedToScheduled(org.joda.time.Duration duration)Adds measurement of an instance for thePARTITION_CREATED_TO_SCHEDULED_MSif the metric is enabled.voidupdatePartitionScheduledToRunning(org.joda.time.Duration duration)Adds measurement of an instance for thePARTITION_SCHEDULED_TO_RUNNING_MSif the metric is enabled.
-
-
-
Field Detail
-
PARTITION_RECORD_COUNT
public static final org.apache.beam.sdk.metrics.Counter PARTITION_RECORD_COUNT
Counter for the total number of partitions identified during the execution of the Connector.
-
PARTITION_RECORD_SPLIT_COUNT
public static final org.apache.beam.sdk.metrics.Counter PARTITION_RECORD_SPLIT_COUNT
Counter for the total number of partition splits / moves identified during the execution of the Connector.
-
PARTITION_RECORD_MERGE_COUNT
public static final org.apache.beam.sdk.metrics.Counter PARTITION_RECORD_MERGE_COUNT
Counter for the total number of partition merges identified during the execution of the Connector.
-
PARTITION_START_RECORD_COUNT
public static final org.apache.beam.sdk.metrics.Counter PARTITION_START_RECORD_COUNT
Counter for the total number of partition start records identified during the execution of the Connector.
-
PARTITION_END_RECORD_COUNT
public static final org.apache.beam.sdk.metrics.Counter PARTITION_END_RECORD_COUNT
Counter for the total number of partition end records identified during the execution of the Connector.
-
PARTITION_EVENT_RECORD_COUNT
public static final org.apache.beam.sdk.metrics.Counter PARTITION_EVENT_RECORD_COUNT
Counter for the total number of partition event records identified during the execution of the Connector.
-
PARTITION_CREATED_TO_SCHEDULED_MS
public static final org.apache.beam.sdk.metrics.Distribution PARTITION_CREATED_TO_SCHEDULED_MS
Time in milliseconds that a partition took to transition fromPartitionMetadata.State.CREATEDtoPartitionMetadata.State.SCHEDULED.
-
PARTITION_SCHEDULED_TO_RUNNING_MS
public static final org.apache.beam.sdk.metrics.Distribution PARTITION_SCHEDULED_TO_RUNNING_MS
Time in milliseconds that a partition took to transition fromPartitionMetadata.State.SCHEDULEDtoPartitionMetadata.State.RUNNING.
-
ACTIVE_PARTITION_READ_COUNT
public static final org.apache.beam.sdk.metrics.Counter ACTIVE_PARTITION_READ_COUNT
Counter for the active partition reads during the execution of the Connector.
-
DATA_RECORD_COUNT
public static final org.apache.beam.sdk.metrics.Counter DATA_RECORD_COUNT
Counter for the total number of data records identified during the execution of the Connector.
-
QUERY_COUNT
public static final org.apache.beam.sdk.metrics.Counter QUERY_COUNT
Counter for the total number of queries issued during the execution of the Connector.
-
DATA_RECORD_COMMITTED_TO_EMITTED_0MS_TO_1000MS_COUNT
public static final org.apache.beam.sdk.metrics.Counter DATA_RECORD_COMMITTED_TO_EMITTED_0MS_TO_1000MS_COUNT
Counter for record latencies [0, 1000) ms during the execution of the Connector.
-
DATA_RECORD_COMMITTED_TO_EMITTED_1000MS_TO_3000MS_COUNT
public static final org.apache.beam.sdk.metrics.Counter DATA_RECORD_COMMITTED_TO_EMITTED_1000MS_TO_3000MS_COUNT
Counter for record latencies [1000, 3000) ms during the execution of the Connector.
-
DATA_RECORD_COMMITTED_TO_EMITTED_3000MS_TO_INF_COUNT
public static final org.apache.beam.sdk.metrics.Counter DATA_RECORD_COMMITTED_TO_EMITTED_3000MS_TO_INF_COUNT
Counter for record latencies equal or above 3000ms during the execution of the Connector.
-
HEARTBEAT_RECORD_COUNT
public static final org.apache.beam.sdk.metrics.Counter HEARTBEAT_RECORD_COUNT
Counter for the total number of heartbeat records identified during the execution of the Connector.
-
-
Constructor Detail
-
ChangeStreamMetrics
public ChangeStreamMetrics()
Constructs a ChangeStreamMetrics instance with the following metrics enabled by default.
-
ChangeStreamMetrics
public ChangeStreamMetrics(java.util.Set<org.apache.beam.sdk.metrics.MetricName> enabledMetrics)
Constructs a ChangeStreamMetrics instance with the given metrics enabled.- Parameters:
enabledMetrics- metrics to be enabled during the Connector execution
-
-
Method Detail
-
incPartitionRecordCount
public void incPartitionRecordCount()
Increments thePARTITION_RECORD_COUNTby 1 if the metric is enabled.
-
incPartitionRecordSplitCount
public void incPartitionRecordSplitCount()
Increments thePARTITION_RECORD_SPLIT_COUNTby 1 if the metric is enabled.
-
incPartitionRecordMergeCount
public void incPartitionRecordMergeCount()
Increments thePARTITION_RECORD_MERGE_COUNTby 1 if the metric is enabled.
-
incPartitionStartRecordCount
public void incPartitionStartRecordCount()
Increments thePARTITION_START_RECORD_COUNTby 1 if the metric is enabled.
-
incPartitionEndRecordCount
public void incPartitionEndRecordCount()
Increments thePARTITION_END_RECORD_COUNTby 1 if the metric is enabled.
-
incPartitionEventRecordCount
public void incPartitionEventRecordCount()
Increments thePARTITION_END_RECORD_COUNTby 1 if the metric is enabled.
-
updatePartitionCreatedToScheduled
public void updatePartitionCreatedToScheduled(org.joda.time.Duration duration)
Adds measurement of an instance for thePARTITION_CREATED_TO_SCHEDULED_MSif the metric is enabled.
-
updatePartitionScheduledToRunning
public void updatePartitionScheduledToRunning(org.joda.time.Duration duration)
Adds measurement of an instance for thePARTITION_SCHEDULED_TO_RUNNING_MSif the metric is enabled.
-
incActivePartitionReadCounter
public void incActivePartitionReadCounter()
Increments theACTIVE_PARTITION_READ_COUNTby 1 if the metric is enabled.
-
decActivePartitionReadCounter
public void decActivePartitionReadCounter()
Decrements theACTIVE_PARTITION_READ_COUNTby 1 if the metric is enabled.
-
incDataRecordCounter
public void incDataRecordCounter()
Increments theDATA_RECORD_COUNTby 1 if the metric is enabled.
-
incQueryCounter
public void incQueryCounter()
Increments theQUERY_COUNTby 1 if the metric is enabled.
-
incHeartbeatRecordCount
public void incHeartbeatRecordCount()
Increments theHEARTBEAT_RECORD_COUNTby 1 if the metric is enabled.
-
updateDataRecordCommittedToEmitted
public void updateDataRecordCommittedToEmitted(org.joda.time.Duration duration)
-
-