You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fa...@apache.org on 2023/07/04 11:26:03 UTC

[flink-benchmarks] branch 32506/wm-agg-benchmark updated (0211ff3 -> 6990cfa)

This is an automated email from the ASF dual-hosted git repository.

fanrui pushed a change to branch 32506/wm-agg-benchmark
in repository https://gitbox.apache.org/repos/asf/flink-benchmarks.git


    omit 0211ff3  Address the comment
    omit 1c03191  [FLINK-32506][connectors/common] Add the benchmark for watermark aggregation
     new 6990cfa  [FLINK-32506][connectors/common] Add the benchmark for watermark aggregation

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (0211ff3)
            \
             N -- N -- N   refs/heads/32506/wm-agg-benchmark (6990cfa)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


[flink-benchmarks] 01/01: [FLINK-32506][connectors/common] Add the benchmark for watermark aggregation

Posted by fa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fanrui pushed a commit to branch 32506/wm-agg-benchmark
in repository https://gitbox.apache.org/repos/asf/flink-benchmarks.git

commit 6990cfa339d050f6297aeacacd254229d19705da
Author: fanrui <19...@gmail.com>
AuthorDate: Sat Jul 1 01:34:12 2023 +0800

    [FLINK-32506][connectors/common] Add the benchmark for watermark aggregation
---
 .../benchmark/WatermarkAggregationBenchmark.java   | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/src/main/java/org/apache/flink/benchmark/WatermarkAggregationBenchmark.java b/src/main/java/org/apache/flink/benchmark/WatermarkAggregationBenchmark.java
new file mode 100644
index 0000000..07d6063
--- /dev/null
+++ b/src/main/java/org/apache/flink/benchmark/WatermarkAggregationBenchmark.java
@@ -0,0 +1,75 @@
+/*
+ * 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.flink.benchmark;
+
+import org.apache.flink.runtime.source.coordinator.SourceCoordinatorAlignmentBenchmark;
+
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OperationsPerInvocation;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.TearDown;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+import org.openjdk.jmh.runner.options.VerboseMode;
+
+/** The watermark aggregation benchmark for source coordinator when enabling the watermark alignment. */
+public class WatermarkAggregationBenchmark extends BenchmarkBase {
+
+    private static final int NUM_SUBTASKS = 5000;
+
+    private static final int ROUND_PER_INVOCATION = 10;
+
+    private SourceCoordinatorAlignmentBenchmark benchmark;
+
+    public static void main(String[] args) throws RunnerException {
+        Options options =
+                new OptionsBuilder()
+                        .verbosity(VerboseMode.NORMAL)
+                        .include(".*" + WatermarkAggregationBenchmark.class.getCanonicalName() + ".*")
+                        .build();
+
+        new Runner(options).run();
+    }
+
+    @Setup(Level.Trial)
+    public void setup() throws Exception {
+        benchmark = new SourceCoordinatorAlignmentBenchmark();
+        benchmark.setup(NUM_SUBTASKS);
+    }
+
+    @Benchmark
+    @OperationsPerInvocation(NUM_SUBTASKS * ROUND_PER_INVOCATION)
+    public void aggregateWatermark() {
+        for (int round = 0; round < ROUND_PER_INVOCATION; round++) {
+            benchmark.sendReportedWatermarkToAllSubtasks();
+        }
+    }
+
+    @TearDown(Level.Trial)
+    public void teardown() throws Exception {
+        benchmark.teardown();
+    }
+
+}