[
https://issues.apache.org/jira/browse/BEAM-11075?focusedWorklogId=514271&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-514271
]
ASF GitHub Bot logged work on BEAM-11075:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Nov/20 18:40
Start Date: 19/Nov/20 18:40
Worklog Time Spent: 10m
Work Description: lostluck commented on a change in pull request #13362:
URL: https://github.com/apache/beam/pull/13362#discussion_r527113878
##########
File path: sdks/go/test/load/util.go
##########
@@ -0,0 +1,227 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package load
+
+import (
+ "context"
+ "encoding/json"
+ "flag"
+ "fmt"
+ "io/ioutil"
+ "log"
+ "net/http"
+ "os"
+ "reflect"
+ "strings"
+ "time"
+
+ "github.com/apache/beam/sdks/go/pkg/beam"
+ "github.com/apache/beam/sdks/go/pkg/beam/core/metrics"
+)
+
+const (
+ runtimeMetricNamespace = "RuntimeMonitor"
+ runtimeMetricName = "runtime"
+)
+
+var (
+ influxMeasurement = flag.String(
+ "influx_measurement",
+ "",
+ `An InfluxDB measurement where metrics should be published to.
+ If empty, no metrics will be send to InfluxDB.`)
+ influxDatabase = flag.String(
+ "influx_db_name",
+ "",
+ "InfluxDB database name. If empty, no metrics will be send to
InfluxDB.")
+ influxHost = flag.String(
+ "influx_hostname",
+ "http://localhost:8086",
+ "Hostname and port to connect to InfluxDB. Defaults to
http://localhost:8086.")
+ influxNamespace = flag.String(
+ "influx_namespace",
+ "",
+ `A namespace to be used when constructing InfluxDB's data
points.
+ Used to make some points different from others within the same
measurement.`)
+ runtime = beam.NewDistribution(runtimeMetricNamespace,
runtimeMetricName)
+)
+
+func init() {
+ beam.RegisterType(reflect.TypeOf((*RuntimeMonitor)(nil)).Elem())
+}
+
+// RuntimeMonitor is a DoFn to record processing time in the pipeline.
+//
+// It uses a distribution metric which is updated every time new bundle
+// starts or finishes. The processing time can be extracted by calculating
+// the difference of the maximum and the minimum value of the distribution
+// metric.
+type RuntimeMonitor struct{}
+
+// StartBundle updates a distribution metric.
+func (fn *RuntimeMonitor) StartBundle(ctx context.Context, emit func([]byte,
[]byte)) {
+ runtime.Update(ctx, time.Now().Unix())
Review comment:
SGTM As long as it ends up with the right units for the DB vs Java and
Python, it's fine. I'm less familiar so I must ask :).
----------------------------------------------------------------
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: 514271)
Time Spent: 9h (was: 8h 50m)
> 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: 9h
> 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)