You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/09/01 09:08:52 UTC

[GitHub] [beam] pabloem commented on a change in pull request #15429: Add per-batch metrics to JdbcIO.write

pabloem commented on a change in pull request #15429:
URL: https://github.com/apache/beam/pull/15429#discussion_r699634493



##########
File path: sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java
##########
@@ -1694,6 +1700,7 @@ private void executeBatch() throws SQLException, IOException, InterruptedExcepti
         if (records.isEmpty()) {
           return;
         }
+        Long startTimeNs = System.nanoTime();

Review comment:
       `currentTimeMillis` may be affected by clock adjustments in the machine, while `nanoTime` measures ellapsed time in the machine, so it will not be affected by that.

##########
File path: sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java
##########
@@ -1694,6 +1700,7 @@ private void executeBatch() throws SQLException, IOException, InterruptedExcepti
         if (records.isEmpty()) {
           return;
         }
+        Long startTimeNs = System.nanoTime();

Review comment:
       https://stackoverflow.com/questions/1770010/how-do-i-measure-time-elapsed-in-java




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org