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

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

                Author: ASF GitHub Bot
            Created on: 08/Feb/19 11:22
            Start Date: 08/Feb/19 11:22
    Worklog Time Spent: 10m 
      Work Description: lgajowy commented on pull request #7772: [BEAM-6627] 
Added Metrics API processing time reporting to TextIOIT
URL: https://github.com/apache/beam/pull/7772#discussion_r255034550
 
 

 ##########
 File path: 
sdks/java/io/file-based-io-tests/src/test/java/org/apache/beam/sdk/io/common/FileBasedIOITHelper.java
 ##########
 @@ -65,6 +71,36 @@ public void processElement(ProcessContext c) {
     }
   }
 
+  public static void publishTestMetrics(
+      PipelineResult result,
+      String bigQueryTable,
+      String bigQueryDataset,
+      String namespace,
+      String writeStartName,
+      String writeEndName,
+      String readStartName,
+      String readEndName) {
+    if (bigQueryTable != null && bigQueryDataset != null) {
+      MetricsReader reader = new MetricsReader(result, namespace);
+      long writeStart = reader.getStartTimeMetric(writeStartName);
+      long writeEnd = reader.getEndTimeMetric(writeEndName);
+      long readStart = reader.getStartTimeMetric(readStartName);
+      long readEnd = reader.getEndTimeMetric(readEndName);
+      double writeTime = (writeEnd - writeStart) / 1000.0;
+      double readTime = (readEnd - readStart) / 1000.0;
+
+      String uuid = UUID.randomUUID().toString();
 
 Review comment:
   Please use the same testID for all NamedTestResuts in this test.
   
   *Test id makes selecting all metrics from a particular test run easier in 
BigQuery. Because of that, the testID should be the same for all metrics in a 
test invocation.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 196166)
    Time Spent: 50m  (was: 40m)

> 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: 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to