Class 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 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.

    • Constructor Detail

      • StreamingInsertsMetricsImpl

        public StreamingInsertsMetricsImpl()
    • Method Detail

      • updateRetriedRowsWithStatus

        public void updateRetriedRowsWithStatus​(java.lang.String status,
                                                int retriedRows)
        Update metrics for rows that were retried due to an RPC error.
        Specified by:
        updateRetriedRowsWithStatus in interface StreamingInsertsMetrics
      • 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:
        updateFailedRpcMetrics in interface StreamingInsertsMetrics
      • 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:
        updateSuccessfulRpcMetrics in interface StreamingInsertsMetrics
      • 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 underlying perWorkerMetrics containers. This function will only report metrics once per instance. Subsequent calls to this function will no-op.
        Specified by:
        updateStreamingInsertsMetrics in interface StreamingInsertsMetrics
        Parameters:
        tableRef - BigQuery table that was written to, return early if null.