Class PostProcessingMetricsDoFn

java.lang.Object
org.apache.beam.sdk.transforms.DoFn<DataChangeRecord,DataChangeRecord>
org.apache.beam.sdk.io.gcp.spanner.changestreams.dofn.PostProcessingMetricsDoFn
All Implemented Interfaces:
Serializable, HasDisplayData

public class PostProcessingMetricsDoFn extends DoFn<DataChangeRecord,DataChangeRecord> implements Serializable
A DoFn class to gather metrics about the emitted DataChangeRecords. It will simply delegate the metrics gathering to the ChangeStreamMetrics. The metrics measured in this component are:
  1. The number of data records emitted.
  2. The latency between a record's Cloud Spanner commit timestamp and the time it reached this component (referred as emit timestamp).
  3. The streaming latency of a record from the change stream query.
See Also:
  • Constructor Details

  • Method Details

    • processElement

      @ProcessElement public void processElement(@Element DataChangeRecord dataChangeRecord, DoFn.OutputReceiver<DataChangeRecord> receiver)
      Stage to measure a data records latencies and metrics. The metrics gathered are:
      1. The number of data records emitted.
      2. The latency between a record's Cloud Spanner commit timestamp and the time it reached this component (referred as emit timestamp).
      3. The streaming latency of a record from the change stream query.
      After measurement the record is re-emitted to the next stage.
      Parameters:
      dataChangeRecord - the record to gather metrics for
      receiver - the output receiver of the PostProcessingMetricsDoFn SDF