nzw921rx commented on code in PR #12418: URL: https://github.com/apache/seatunnel/pull/12418#discussion_r4060303627
########## seatunnel-benchmarks/src/main/java/org/apache/seatunnel/benchmark/CheckpointSchedulingBenchmark.java: ########## @@ -0,0 +1,125 @@ +/* + * 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.seatunnel.benchmark; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +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; + +import java.util.concurrent.TimeUnit; + +/** + * Measures how long a due checkpoint trigger waits before its scheduling thread runs it. + * + * <p>This is the part of checkpointing that the scheduling model decides. Checkpoint completion + * time, which {@link CheckpointingTimeBenchmark} measures, is dominated by the barrier round-trip + * and is close to blind to how the trigger was scheduled. + * + * <p>The axis that separates scheduling models is the pipeline count. Every {@code + * CheckpointCoordinator} builds its own two-thread pool, so a member running P pipelines carries 2P + * scheduler threads; a shared pool is a fixed width whatever P is. {@code triggerBodyMicros} is a + * parameter rather than a fixed cost because how long a trigger occupies its thread is what decides + * whether a fixed width is wide enough, and that cost is not the same for every deployment. + * + * <p>{@code checkpointIntervalMillis} defaults far below the production default of 300000 so that a + * benchmark iteration of a few seconds sees a realistic number of triggers. + */ +@BenchmarkMode(Mode.SampleTime) +@OutputTimeUnit(TimeUnit.MICROSECONDS) +@Threads(1) +@Fork( + value = 3, + jvmArgsAppend = { + "-Xms2g", Review Comment: please use: "-Xms4g", "-Xmx4g", -- 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]
