kamilwu commented on a change in pull request #11661:
URL: https://github.com/apache/beam/pull/11661#discussion_r431061661



##########
File path: sdks/python/apache_beam/examples/wordcount_it_test.py
##########
@@ -104,18 +107,33 @@ def _run_wordcount_it(self, run_wordcount, **opts):
     run_time = end_time - start_time
 
     if publish_to_bq:
-      bq_publisher = BigQueryMetricsPublisher(
-          project_name=test_pipeline.get_option('project'),
-          table=test_pipeline.get_option('metrics_table'),
-          dataset=test_pipeline.get_option('metrics_dataset'),
-      )
-      result = Metric(
-          submit_timestamp=time.time(),
-          metric_id=uuid.uuid4().hex,
-          value=run_time,
-          label='Python performance test',
-      )
-      bq_publisher.publish([result.as_dict()])
+      self._publish_metrics(test_pipeline, run_time)
+
+  def _publish_metrics(self, pipeline, metric_value):

Review comment:
       `MetricsReader` from `load_test_metrics_utils` module has a 
`publish_metrics` method. This method takes a pipeline result as an input, 
extracts metrics from it and calls all publishers. I think we could add a 
similar method, e.g. `publish_value`, which would take a list of kv pairs. 
@piotr-szuberski Does it make sense? 




----------------------------------------------------------------
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:
[email protected]


Reply via email to