damccorm commented on code in PR #17673:
URL: https://github.com/apache/beam/pull/17673#discussion_r872912707
##########
sdks/go/test/load/sideinput/sideinput.go:
##########
@@ -51,11 +54,17 @@ func parseSyntheticConfig() synthetic.SourceConfig {
}
}
+// impToKV just turns an impulse signal into a KV instead of
+// adding a single value input version of RuntimeMonitor
+func impToKV(imp []byte, emit func([]byte, []byte)) {
+ emit(imp, imp)
+}
+
type doFn struct {
Review Comment:
I know this predates the change, but would you mind giving this a meaningful
name? Maybe something like firstNKVPairs
##########
sdks/go/test/load/util.go:
##########
@@ -132,10 +133,16 @@ func newLoadTestResult(value float64) loadTestResult {
// PublishMetrics calculates the runtime and sends the result to InfluxDB
database.
func PublishMetrics(results metrics.QueryResults) {
options := newInfluxDBOptions()
- if options.validate() {
- if res := toLoadTestResults(results); len(res) > 0 {
- publishMetricstoInfluxDB(options,
toLoadTestResults(results))
- }
+ ress := toLoadTestResults(results)
+ for _, res := range ress {
+ log.Printf("%s %v", res.metric,
time.Duration(float64(time.Second)*res.value))
+ }
+ if len(ress) == 0 {
+ log.Print("No metrics returned.")
+ return
+ }
+ if options.validate() && len(ress) > 0 {
Review Comment:
```suggestion
if options.validate() {
```
We've already early returned in this case so we probably don't need this. If
you want to be extra explicit you can put it in the else (I'd just cut the
extra clause though)
--
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]