HuangLED 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_r404257103
 
 

 ##########
 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:
   I see. Thanks for the information! 
   
   I checked MetricResult interface, it only works when passed in both 
'commited' and 'attempted'. 
   
   I will take a look what alternative we need to do.  If you by any chance are 
aware of a particular API I should use, please let me know.

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