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
DataChangeRecord
s. It will simply
delegate the metrics gathering to the ChangeStreamMetrics
. The metrics measured in this
component are:
- The number of data records emitted.
- The latency between a record's Cloud Spanner commit timestamp and the time it reached this component (referred as emit timestamp).
- The streaming latency of a record from the change stream query.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.DoFn
DoFn.AlwaysFetched, DoFn.BoundedPerElement, DoFn.BundleFinalizer, DoFn.Element, DoFn.FieldAccess, DoFn.FinishBundle, DoFn.FinishBundleContext, DoFn.GetInitialRestriction, DoFn.GetInitialWatermarkEstimatorState, DoFn.GetRestrictionCoder, DoFn.GetSize, DoFn.GetWatermarkEstimatorStateCoder, DoFn.Key, DoFn.MultiOutputReceiver, DoFn.NewTracker, DoFn.NewWatermarkEstimator, DoFn.OnTimer, DoFn.OnTimerContext, DoFn.OnTimerFamily, DoFn.OnWindowExpiration, DoFn.OnWindowExpirationContext, DoFn.OutputReceiver<T>, DoFn.ProcessContext, DoFn.ProcessContinuation, DoFn.ProcessElement, DoFn.RequiresStableInput, DoFn.RequiresTimeSortedInput, DoFn.Restriction, DoFn.Setup, DoFn.SideInput, DoFn.SplitRestriction, DoFn.StartBundle, DoFn.StartBundleContext, DoFn.StateId, DoFn.Teardown, DoFn.TimerFamily, DoFn.TimerId, DoFn.Timestamp, DoFn.TruncateRestriction, DoFn.UnboundedPerElement, DoFn.WatermarkEstimatorState, DoFn.WindowedContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
processElement
(DataChangeRecord dataChangeRecord, DoFn.OutputReceiver<DataChangeRecord> receiver) Stage to measure a data records latencies and metrics.Methods inherited from class org.apache.beam.sdk.transforms.DoFn
getAllowedTimestampSkew, getInputTypeDescriptor, getOutputTypeDescriptor, populateDisplayData, prepareForProcessing
-
Constructor Details
-
PostProcessingMetricsDoFn
-
-
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:- The number of data records emitted.
- The latency between a record's Cloud Spanner commit timestamp and the time it reached this component (referred as emit timestamp).
- The streaming latency of a record from the change stream query.
- Parameters:
dataChangeRecord
- the record to gather metrics forreceiver
- the output receiver of thePostProcessingMetricsDoFn
SDF
-