You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/05/04 10:02:30 UTC

[GitHub] [beam] mwalenia commented on a change in pull request #11534: Push ioit tests metrics to influxdb

mwalenia commented on a change in pull request #11534:
URL: https://github.com/apache/beam/pull/11534#discussion_r419314057



##########
File path: sdks/java/testing/test-utils/src/main/java/org/apache/beam/sdk/testutils/publishing/InfluxDBSettings.java
##########
@@ -0,0 +1,87 @@
+/*
+ * 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 org.apache.beam.sdk.testutils.publishing;
+
+import static java.util.Objects.isNull;
+
+import java.util.Arrays;
+import java.util.Objects;
+
+public final class InfluxDBSettings {

Review comment:
       You can omit all the bolierplate here (including the builder) by using AutoValue, did you consider it?

##########
File path: sdks/java/testing/test-utils/src/main/java/org/apache/beam/sdk/testutils/metrics/IOITMetrics.java
##########
@@ -70,4 +72,21 @@ public static void publish(
     }
     ConsoleResultPublisher.publish(results, uuid, timestamp);
   }
+
+  public void publishToInflux(final InfluxDBSettings settings) {
+    MetricsReader reader = new MetricsReader(result, namespace);
+    Collection<NamedTestResult> namedTestResults = reader.readAll(metricSuppliers);
+
+    InfluxDBPublisher.publishWithSettings(namedTestResults, settings);
+  }
+
+  public static void publishToInflux(
+      final String uuid,
+      final String timestamp,
+      final Collection<NamedTestResult> results,
+      final InfluxDBSettings settings) {
+
+    InfluxDBPublisher.publishWithSettings(results, settings);
+    ConsoleResultPublisher.publish(results, uuid, timestamp);

Review comment:
       For the time being this is unnecessary, the results will be published to the console twice, since BQ publisher does the same thing.




----------------------------------------------------------------
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:
users@infra.apache.org