[
https://issues.apache.org/jira/browse/BEAM-11075?focusedWorklogId=507595&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-507595
]
ASF GitHub Bot logged work on BEAM-11075:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Nov/20 11:03
Start Date: 04/Nov/20 11:03
Worklog Time Spent: 10m
Work Description: kamilwu commented on a change in pull request #13245:
URL: https://github.com/apache/beam/pull/13245#discussion_r517263905
##########
File path: sdks/go/pkg/beam/io/synthetic/source_test.go
##########
@@ -168,62 +169,48 @@ func TestSourceConfig_BuildFromJSON(t *testing.T) {
// for a synthetic source works correctly.
func TestSourceConfigBuilder_NumHotKeys(t *testing.T) {
tests := []struct {
- elms int
- hotKeys int
+ elms int
+ hotKeys int
+ hotKeyFraction float64
}{
- {elms: 15, hotKeys: 2},
- {elms: 30, hotKeys: 10},
- {elms: 50, hotKeys: 25},
+ {elms: 15, hotKeys: 2, hotKeyFraction: 1.0},
+ {elms: 30, hotKeys: 10, hotKeyFraction: 1.0},
+ {elms: 50, hotKeys: 25, hotKeyFraction: 1.0},
+ {elms: 30, hotKeys: 10, hotKeyFraction: 0.5},
+ {elms: 50, hotKeys: 25, hotKeyFraction: 0.75},
}
for _, test := range tests {
test := test
t.Run(fmt.Sprintf("(elm = %v)", test.hotKeys), func(t
*testing.T) {
dfn := sourceFn{}
cfg := DefaultSourceConfig()
cfg.NumElements(test.elms)
- cfg.HotKeyFraction(1.0)
+ cfg.HotKeyFraction(test.hotKeyFraction)
cfg.NumHotKeys(test.hotKeys)
keys, _, err := simulateSourceFn(t, &dfn, cfg.Build())
if err != nil {
t.Errorf("Failure processing sourceFn: %v", err)
}
- type val struct {
- num int
- isHotKey bool
- }
-
- m := make(map[string]val)
+ m := make(map[string]int)
for i := 0; i < len(keys); i++ {
Review comment:
Do you really need nested iterations? If I'm not mistaken, this code
would be just fine:
```
for _, key := range keys {
encoded := hex.EncodeToString(key)
m[encoded]++
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 507595)
Time Spent: 2h 20m (was: 2h 10m)
> Load Tests for Go SDK
> ---------------------
>
> Key: BEAM-11075
> URL: https://issues.apache.org/jira/browse/BEAM-11075
> Project: Beam
> Issue Type: Test
> Components: sdk-go, testing
> Reporter: Kamil Wasilewski
> Assignee: Kamil Wasilewski
> Priority: P3
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> We have Load Tests for Python and Java SDKs[1], but we are missing the ones
> for Go SDK.
> Tests to be done:
> * ParDo
> * Combine
> * coGBK
> * GBK
> * Side Input
> The tests should run on Dataflow and Flink. The tests should be using
> synthetic source and be running in batch mode.
> [1]http://metrics.beam.apache.org/dashboards/f/OtXje1iGz/performance-tests-metrics
--
This message was sent by Atlassian Jira
(v8.3.4#803005)