[ 
https://issues.apache.org/jira/browse/BEAM-6627?focusedWorklogId=352563&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-352563
 ]

ASF GitHub Bot logged work on BEAM-6627:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Dec/19 11:32
            Start Date: 03/Dec/19 11:32
    Worklog Time Spent: 10m 
      Work Description: lgajowy commented on pull request #10267: [BEAM-6627] 
Add size reporting to JdbcIOIT
URL: https://github.com/apache/beam/pull/10267#discussion_r353126103
 
 

 ##########
 File path: 
sdks/java/io/jdbc/src/test/java/org/apache/beam/sdk/io/jdbc/JdbcIOIT.java
 ##########
 @@ -148,6 +150,18 @@ private void gatherAndPublishMetrics(PipelineResult 
writeResult, PipelineResult
           return NamedTestResult.create(
               uuid, timestamp, "write_time", (writeEnd - writeStart) / 1e3);
         });
+
+    suppliers.add(
+        ignore -> {
+          try {
+            Long tableSizeAfterWrite =
+                DatabaseTestHelper.getPostgresTableSize(dataSource, tableName);
+            return NamedTestResult.create(
+                uuid, timestamp, "total_size", tableSizeAfterWrite - 
tableSize);
+          } catch (SQLException e) {
 
 Review comment:
   In this case optional could be useful too. The `getPostgresTableSize` could 
catch the error and return `empty()` in case of problems. Then, here, you could 
decide if to publish the metric or not, or even fail the whole test, depending 
on whether you have all the necessary metrics collected. 
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 352563)
    Time Spent: 16h 20m  (was: 16h 10m)

> Use Metrics API in IO performance tests
> ---------------------------------------
>
>                 Key: BEAM-6627
>                 URL: https://issues.apache.org/jira/browse/BEAM-6627
>             Project: Beam
>          Issue Type: Improvement
>          Components: testing
>            Reporter: Michal Walenia
>            Assignee: Michal Walenia
>            Priority: Minor
>          Time Spent: 16h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to