JayajP commented on code in PR #30717:
URL: https://github.com/apache/beam/pull/30717#discussion_r1539617724


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StreamingInsertsMetrics.java:
##########
@@ -156,6 +156,19 @@ public void updateSuccessfulAndFailedRows(int totalRows, 
int failedRows) {
       }
     }
 
+    /** Record rpc latency histogram metrics. */
+    private void recordRpcLatencyMetrics() {
+      Histogram latencyHistogram =
+          BigQuerySinkMetrics.createRPCLatencyHistogram(
+              BigQuerySinkMetrics.RpcMethod.STREAMING_INSERTS);
+      Object[] rpcLatencyObjs = rpcLatencies().toArray();
+      double[] rpcLatencies = new double[rpcLatencyObjs.length];

Review Comment:
   Looks like there's a handful of custom map functions to map to specific 
primitives. I used this sequence. 
   ```
   double[] rpcLatencies =
     rpcLatencies().stream().mapToDouble(duration -> 
duration.toMillis()).toArray();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to