lukecwik commented on a change in pull request #11319: [BEAM-9703]Include user 
distritribution into metric-dedicated validate runner test.
URL: https://github.com/apache/beam/pull/11319#discussion_r404247965
 
 

 ##########
 File path: sdks/python/apache_beam/metrics/metric_test.py
 ##########
 @@ -162,6 +169,17 @@ def process(self, element):
         outputs_counter.key.metric.name, 'metrics_user_counter_element')
     self.assertEqual(outputs_counter.committed, 4)
 
+    # Verify user distribution counter.
+    metric_results = res.metrics().query()
+    namespace = 'apache_beam.metrics.metric_test.SomeDoFn'
+    hc.assert_that(
+        metric_results['distributions'],
+        hc.contains_inanyorder(
+            MetricResult(
+                MetricKey('ApplyPardo', MetricName(namespace, 'element_dist')),
+                DistributionResult(DistributionData(10, 4, 1, 4)),
+                DistributionResult(DistributionData(10, 4, 1, 4)))))
 
 Review comment:
   not all runners support attempted metrics, please only compare against 
committed metrics for now

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to