reuvenlax commented on code in PR #17417:
URL: https://github.com/apache/beam/pull/17417#discussion_r863985565


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java:
##########
@@ -275,7 +321,13 @@ void flush(RetryManager<AppendRowsResponse, 
Context<AppendRowsResponse>> retryMa
                   offset = this.currentOffset;
                   this.currentOffset += inserts.getSerializedRowsCount();
                 }
-                return writeStream.appendRows(offset, protoRows);
+                ApiFuture<AppendRowsResponse> response = 
writeStream.appendRows(offset, protoRows);
+                
inflightWaitSecondsDistribution.update(writeStream.getInflightWaitSeconds());
+                if (writeStream.getInflightWaitSeconds() > 5) {
+                  LOG.warn(
+                      "Storage Api write delay more than " + 
writeStream.getInflightWaitSeconds());
+                }
+                return response;

Review Comment:
   getInFlightWaitSeconds does measure the exec time of the lambda for the most 
part (the rest of the code merely appends to an in-memory list, which should be 
very fast). Locking is better measured with a contention metric I think - need 
to see if we have any way of measuring this in the wild.



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