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 2022/09/07 09:46:36 UTC

[GitHub] [beam] mosche commented on a diff in pull request #23041: Publish results of JMH benchmark runs (Java SDK) to InfluxDB (#22238).

mosche commented on code in PR #23041:
URL: https://github.com/apache/beam/pull/23041#discussion_r964627809


##########
sdks/java/testing/test-utils/src/main/java/org/apache/beam/sdk/testutils/jmh/Main.java:
##########
@@ -0,0 +1,150 @@
+/*
+ * 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.jmh;
+
+import static java.util.function.Function.identity;
+import static java.util.stream.Collectors.toList;
+import static java.util.stream.Collectors.toMap;
+import static org.openjdk.jmh.annotations.Mode.SingleShotTime;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+import javax.annotation.Nullable;
+import org.apache.beam.sdk.testutils.publishing.InfluxDBPublisher;
+import org.apache.beam.sdk.testutils.publishing.InfluxDBPublisher.DataPoint;
+import org.apache.beam.sdk.testutils.publishing.InfluxDBSettings;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.infra.BenchmarkParams;
+import org.openjdk.jmh.results.BenchmarkResult;
+import org.openjdk.jmh.results.BenchmarkResultMetaData;
+import org.openjdk.jmh.results.Result;
+import org.openjdk.jmh.results.RunResult;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.CommandLineOptionException;
+import org.openjdk.jmh.runner.options.CommandLineOptions;
+
+/**
+ * Custom main wrapper around the {@link Runner JMH runner} that supports publishing benchmarks to
+ * InfluxDB.
+ *
+ * <p>If {@link InfluxDBSettings} can be inferred from the environment, benchmark results will be
+ * published to InfluxDB. Otherwise this will just delegate to the default {@link
+ * org.openjdk.jmh.Main JMH Main} class.
+ *
+ * <p>Use the following environment variables to configure {@link InfluxDBSettings}:

Review Comment:
   I've updated the Java docs to describe tags & fields written. Let me know if anything remains unclear.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org