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 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 updateStreamingInsertsMetrics
which will export all counters metrics and RPC latency distribution metrics to the underlying
perWorkerMetrics
container. 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 -
Method Summary
Modifier and TypeMethodDescriptioncreate()
void
updateFailedRpcMetrics
(Instant start, Instant end, String status) Record the rpc status and latency of a failed StreamingInserts RPC call.void
updateRetriedRowsWithStatus
(String status, int retriedRows) Update metrics for rows that were retried due to an RPC error.void
updateStreamingInsertsMetrics
(TableReference tableRef, int totalRows, int failedRows) Export all metrics recorded in this instance to the underlyingperWorkerMetrics
containers.void
updateSuccessfulRpcMetrics
(Instant start, Instant end) Record the rpc status and latency of a successful StreamingInserts RPC call.
-
Constructor Details
-
StreamingInsertsMetricsImpl
public StreamingInsertsMetricsImpl()
-
-
Method Details
-
create
-
updateRetriedRowsWithStatus
Update metrics for rows that were retried due to an RPC error.- Specified by:
updateRetriedRowsWithStatus
in interfaceStreamingInsertsMetrics
-
updateFailedRpcMetrics
Record the rpc status and latency of a failed StreamingInserts RPC call.- Specified by:
updateFailedRpcMetrics
in interfaceStreamingInsertsMetrics
-
updateSuccessfulRpcMetrics
Record the rpc status and latency of a successful StreamingInserts RPC call.- Specified by:
updateSuccessfulRpcMetrics
in interfaceStreamingInsertsMetrics
-
updateStreamingInsertsMetrics
public void updateStreamingInsertsMetrics(@Nullable TableReference tableRef, int totalRows, int failedRows) Export all metrics recorded in this instance to the underlyingperWorkerMetrics
containers. This function will only report metrics once per instance. Subsequent calls to this function will no-op.- Specified by:
updateStreamingInsertsMetrics
in interfaceStreamingInsertsMetrics
- Parameters:
tableRef
- BigQuery table that was written to, return early if null.
-