[
https://issues.apache.org/jira/browse/BEAM-11217?focusedWorklogId=679277&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-679277
]
ASF GitHub Bot logged work on BEAM-11217:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Nov/21 20:04
Start Date: 09/Nov/21 20:04
Worklog Time Spent: 10m
Work Description: lostluck commented on a change in pull request #15923:
URL: https://github.com/apache/beam/pull/15923#discussion_r745972612
##########
File path: sdks/go/pkg/beam/core/runtime/metricsx/metricsx.go
##########
@@ -100,17 +112,38 @@ func groupByType(minfos []*pipepb.MonitoringInfo) (
v.Total = value
}
msecs[key] = v
+ case UrnToString(UrnElementCount):
+ value, err := extractCounterValue(r)
+ if err != nil {
+ log.Println(err)
+ continue
+ }
+ v := pcols[key]
+ v.ElementCount = value
+ pcols[key] = v
+ case UrnToString(UrnSampledByteSize):
+ value, err := extractDistributionValue(r)
+ if err != nil {
+ log.Println(err)
+ continue
+ }
+ v := pcols[key]
+ v.SampledByteSize = value
+ pcols[key] = v
default:
log.Println("unknown metric type")
}
}
- return counters, distributions, gauges, msecs
+ return counters, distributions, gauges, msecs, pcols
}
-func extractKey(mi *pipepb.MonitoringInfo) (metrics.StepKey, error) {
+func extractKey(mi *pipepb.MonitoringInfo, p map[string]string)
(metrics.StepKey, error) {
labels := newLabels(mi.GetLabels())
stepName := labels.Transform()
+ if v, ok := p[labels.PCollection()]; ok {
Review comment:
Consider a longer name for the `p` parameter since the types don't
indicate usage clearly. Go does prefer shorter names, but not at the loss of
clarity.
```suggestion
func extractKey(mi *pipepb.MonitoringInfo, colToTransform map[string]string)
(metrics.StepKey, error) {
labels := newLabels(mi.GetLabels())
stepName := labels.Transform()
if v, ok := colToTransform[labels.PCollection()]; ok {
```
--
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: 679277)
Time Spent: 14h 20m (was: 14h 10m)
> 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
> Priority: P3
> Time Spent: 14h 20m
> 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.20.1#820001)