hjtran commented on code in PR #36334:
URL: https://github.com/apache/beam/pull/36334#discussion_r2395475125


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6327,19 +6327,16 @@ class MyMetricsDoFn(beam.DoFn):
     self.counter = metrics.Metrics.counter("namespace", "counter1")
 
   def process(self, element):
-    counter.inc()
+    self.counter.inc()
     yield element
 
-pipeline = beam.Pipeline()
-
-pipeline | beam.ParDo(MyMetricsDoFn())
-
-result = pipeline.run().wait_until_finish()
+with beam.Pipeline(runner=BundleBasedDirectRunner()) as p:
+  p | beam.Create([1, 2, 3]) | beam.ParDo(MyMetricsDoFn())
 
-metrics = result.metrics().query(
-    metrics.MetricsFilter.with_namespace("namespace").with_name("counter1"))
+metrics_ = p.result.metrics().query(

Review Comment:
   Yeah I struggled to find a name that didn't overshadow the module name. I've 
changed it now to `query_result`



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to