[ 
https://issues.apache.org/jira/browse/BEAM-11217?focusedWorklogId=652793&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-652793
 ]

ASF GitHub Bot logged work on BEAM-11217:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Sep/21 06:31
            Start Date: 20/Sep/21 06:31
    Worklog Time Spent: 10m 
      Work Description: 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 652793)
    Time Spent: 2h 50m  (was: 2h 40m)

> Implement metrics filtering
> ---------------------------
>
>                 Key: BEAM-11217
>                 URL: https://issues.apache.org/jira/browse/BEAM-11217
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-go
>            Reporter: Kamil Wasilewski
>            Assignee: Ritesh Ghorse
>            Priority: P3
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> `metrics.Results` misses a method for querying metrics using a provided 
> filter. The method should take a filter object as an argument and return 
> `metrics.QueryResults` object containing metrics that matched the filter.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to