Class StreamingInsertsMetrics.StreamingInsertsMetricsImpl
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.bigquery.StreamingInsertsMetrics.StreamingInsertsMetricsImpl
-
- All Implemented Interfaces:
StreamingInsertsMetrics
- Enclosing interface:
- StreamingInsertsMetrics
public abstract static class StreamingInsertsMetrics.StreamingInsertsMetricsImpl extends java.lang.Object implements StreamingInsertsMetrics
Metrics of a batch of InsertAll RPCs. Member variables are thread safe; however, this class does not have atomicity across member variables.Expected usage: A number of threads record metrics in an instance of this class with the member methods. Afterwards, a single thread should call
updateStreamingInsertsMetricswhich will export all counters metrics and RPC latency distribution metrics to the underlyingperWorkerMetricscontainer. Afterwards, metrics should not be written/read from this object.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.beam.sdk.io.gcp.bigquery.StreamingInsertsMetrics
StreamingInsertsMetrics.NoOpStreamingInsertsMetrics, StreamingInsertsMetrics.StreamingInsertsMetricsImpl
-
-
Constructor Summary
Constructors Constructor Description StreamingInsertsMetricsImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StreamingInsertsMetrics.StreamingInsertsMetricsImplcreate()voidupdateFailedRpcMetrics(java.time.Instant start, java.time.Instant end, java.lang.String status)Record the rpc status and latency of a failed StreamingInserts RPC call.voidupdateRetriedRowsWithStatus(java.lang.String status, int retriedRows)Update metrics for rows that were retried due to an RPC error.voidupdateStreamingInsertsMetrics(com.google.api.services.bigquery.model.TableReference tableRef, int totalRows, int failedRows)Export all metrics recorded in this instance to the underlyingperWorkerMetricscontainers.voidupdateSuccessfulRpcMetrics(java.time.Instant start, java.time.Instant end)Record the rpc status and latency of a successful StreamingInserts RPC call.
-
-
-
Method Detail
-
create
public static StreamingInsertsMetrics.StreamingInsertsMetricsImpl create()
-
updateRetriedRowsWithStatus
public void updateRetriedRowsWithStatus(java.lang.String status, int retriedRows)Update metrics for rows that were retried due to an RPC error.- Specified by:
updateRetriedRowsWithStatusin interfaceStreamingInsertsMetrics
-
updateFailedRpcMetrics
public void updateFailedRpcMetrics(java.time.Instant start, java.time.Instant end, java.lang.String status)Record the rpc status and latency of a failed StreamingInserts RPC call.- Specified by:
updateFailedRpcMetricsin interfaceStreamingInsertsMetrics
-
updateSuccessfulRpcMetrics
public void updateSuccessfulRpcMetrics(java.time.Instant start, java.time.Instant end)Record the rpc status and latency of a successful StreamingInserts RPC call.- Specified by:
updateSuccessfulRpcMetricsin interfaceStreamingInsertsMetrics
-
updateStreamingInsertsMetrics
public void updateStreamingInsertsMetrics(@Nullable com.google.api.services.bigquery.model.TableReference tableRef, int totalRows, int failedRows)Export all metrics recorded in this instance to the underlyingperWorkerMetricscontainers. This function will only report metrics once per instance. Subsequent calls to this function will no-op.- Specified by:
updateStreamingInsertsMetricsin interfaceStreamingInsertsMetrics- Parameters:
tableRef- BigQuery table that was written to, return early if null.
-
-