public abstract static class StreamingInsertsMetrics.StreamingInsertsMetricsImpl extends java.lang.Object implements StreamingInsertsMetrics
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.
StreamingInsertsMetrics.NoOpStreamingInsertsMetrics, StreamingInsertsMetrics.StreamingInsertsMetricsImpl
Constructor and Description |
---|
StreamingInsertsMetricsImpl() |
Modifier and Type | Method and Description |
---|---|
static StreamingInsertsMetrics.StreamingInsertsMetricsImpl |
create() |
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.
|
void |
updateRetriedRowsWithStatus(java.lang.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 underlying
perWorkerMetrics
containers. |
void |
updateSuccessfulRpcMetrics(java.time.Instant start,
java.time.Instant end)
Record the rpc status and latency of a successful StreamingInserts RPC call.
|
public static StreamingInsertsMetrics.StreamingInsertsMetricsImpl create()
public void updateRetriedRowsWithStatus(java.lang.String status, int retriedRows)
updateRetriedRowsWithStatus
in interface StreamingInsertsMetrics
public void updateFailedRpcMetrics(java.time.Instant start, java.time.Instant end, java.lang.String status)
updateFailedRpcMetrics
in interface StreamingInsertsMetrics
public void updateSuccessfulRpcMetrics(java.time.Instant start, java.time.Instant end)
updateSuccessfulRpcMetrics
in interface StreamingInsertsMetrics
public void updateStreamingInsertsMetrics(@Nullable TableReference tableRef, int totalRows, int failedRows)
perWorkerMetrics
containers. This function will only report metrics once per instance. Subsequent calls to
this function will no-op.updateStreamingInsertsMetrics
in interface StreamingInsertsMetrics
tableRef
- BigQuery table that was written to, return early if null.