[ https://issues.apache.org/jira/browse/BEAM-7721?focusedWorklogId=293701&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-293701 ]
ASF GitHub Bot logged work on BEAM-7721: ---------------------------------------- Author: ASF GitHub Bot Created on: 13/Aug/19 07:55 Start Date: 13/Aug/19 07:55 Worklog Time Spent: 10m Work Description: mwalenia commented on pull request #9295: [BEAM-7721] Add write test to BigQueryIOIT URL: https://github.com/apache/beam/pull/9295#discussion_r313262677 ########## File path: sdks/java/io/bigquery-io-tests/src/test/java/org/apache/beam/sdk/bigqueryiotests/BigQueryIOIT.java ########## @@ -151,46 +159,51 @@ private static void createAndFillSourceTable() { return tableRow; }) .withCustomGcsTempLocation(ValueProvider.StaticValueProvider.of(tempRoot)) + .withMethod(method) .withSchema( new TableSchema() .setFields( Collections.singletonList( new TableFieldSchema().setName("data").setType("BYTES"))))); - pipeline.run().waitUntilFinish(); + + PipelineResult pipelineResult = pipeline.run(); + pipelineResult.waitUntilFinish(); + extractAndPublishTime(pipelineResult, WRITE_TIME_METRIC_NAME); } - private static boolean checkForSourceTable() { - BigQueryOptions options = BigQueryOptions.newBuilder().build(); - BigQuery client = options.getService(); - TableId tableId = - TableId.of(options.getProjectId(), bigQuerySourceDataset, bigQuerySourceTable); - Table sourceTable = client.getTable(tableId, TableOption.fields(BigQuery.TableField.TYPE)); - return sourceTable != null; + private void extractAndPublishTime(PipelineResult pipelineResult, String writeTimeMetricName) { + NamedTestResult metricResult = + getMetricSupplier(writeTimeMetricName).apply(new MetricsReader(pipelineResult, NAMESPACE)); + IOITMetrics.publish( + TEST_ID, + TEST_TIMESTAMP, + bigQueryMetricsDataset, + bigQueryMetricsTable, + Collections.singletonList(metricResult)); } @Test - public void testRead() { + public void testWriteThenRead() { Review comment: Ok, moved. ---------------------------------------------------------------- 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: 293701) Time Spent: 8h 20m (was: 8h 10m) > Measure throughput in BigQueryIO read in Java > --------------------------------------------- > > Key: BEAM-7721 > URL: https://issues.apache.org/jira/browse/BEAM-7721 > Project: Beam > Issue Type: Improvement > Components: testing > Reporter: Michal Walenia > Assignee: Michal Walenia > Priority: Major > Time Spent: 8h 20m > Remaining Estimate: 0h > > Collect bytes/time metric in BQ read tests in Java SDK -- This message was sent by Atlassian JIRA (v7.6.14#76016)