youngoli commented on a change in pull request #15482:
URL: https://github.com/apache/beam/pull/15482#discussion_r711897955



##########
File path: sdks/go/pkg/beam/core/metrics/metrics.go
##########
@@ -482,7 +482,39 @@ func (mr Results) AllMetrics() QueryResults {
        return QueryResults{mr.counters, mr.distributions, mr.gauges}
 }
 
-// TODO(BEAM-11217): Implement Query(Filter) and metrics filtering
+// SingleResult interface facilitates metrics query filtering methods.
+type SingleResult interface {
+       Step() string
+       Name() string
+       Namespace() string
+}
+
+// Query allows metrics querying with filter. The filter takes the form of 
predicate function.
+// Ex: qr = pr.Metrics().Query(func(sr metrics.SingleResult) bool {
+//                     return sr.Namespace() == test.namespace
+// })

Review comment:
       Nit: To format code blocks correctly in Godocs, you need to have them 
indented.
   ```suggestion
   // Query allows metrics querying with filter. The filter takes the form of 
predicate function. Example:
   //   qr = pr.Metrics().Query(func(sr metrics.SingleResult) bool {
   //       return sr.Namespace() == test.namespace
   //   })
   ```




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