[
https://issues.apache.org/jira/browse/BEAM-5097?focusedWorklogId=131637&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-131637
]
ASF GitHub Bot logged work on BEAM-5097:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Aug/18 22:35
Start Date: 06/Aug/18 22:35
Worklog Time Spent: 10m
Work Description: lostluck commented on a change in pull request #6157:
[BEAM-5097] Add counter to combine example in go sdk
URL: https://github.com/apache/beam/pull/6157#discussion_r208048664
##########
File path: sdks/go/examples/cookbook/combine/combine.go
##########
@@ -63,11 +63,16 @@ type extractFn struct {
MinLength int `json:"min_length"`
}
+// A global context for simplicity.
+var ctx = context.Background()
+
func (f *extractFn) ProcessElement(row WordRow, emit func(string, string)) {
+ small_words := beam.NewCounter("example.namespace", "small_words")
Review comment:
For perf reasons it's better to declare the counter in the package scope,
but either works correctly.
Better to show the recommended path as part of real examples or recipes I
think.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 131637)
Time Spent: 40m (was: 0.5h)
> Increment counter for "small words" in go SDK example
> -----------------------------------------------------
>
> Key: BEAM-5097
> URL: https://issues.apache.org/jira/browse/BEAM-5097
> Project: Beam
> Issue Type: Improvement
> Components: sdk-go
> Reporter: holdenk
> Assignee: holdenk
> Priority: Trivial
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Increment counter for "small words" in go SDK example
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)