sk0x50 commented on code in PR #5081: URL: https://github.com/apache/ignite-3/pull/5081#discussion_r1925384683
########## modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/CreatingDistributionZoneBenchmark.java: ########## @@ -0,0 +1,115 @@ +/* + * 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.ignite.internal.benchmark; + +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static org.apache.ignite.internal.catalog.CatalogService.DEFAULT_STORAGE_PROFILE; +import static org.openjdk.jmh.annotations.Mode.AverageTime; + +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.ignite.catalog.definitions.ZoneDefinition; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +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; + +/** + * Benchmark that measures creating a new empty distribution zone. + * The word `empty` means that the zone has no tables. + */ +@Fork(1) +@State(Scope.Benchmark) +public class CreatingDistributionZoneBenchmark extends AbstractMultiNodeBenchmark { + @Param({"3"}) + private int clusterSize; + + @Param({"1", "8"}) + private int partitionCount; + + @Param({"1", "3"}) + private int replicaCount; + + /** Distribution zones counter. */ + private AtomicInteger cnt = new AtomicInteger(); + + @Override + protected int nodes() { + return clusterSize; + } + + @Override + protected int partitionCount() { + return partitionCount; + } + + @Override + protected int replicaCount() { + return replicaCount; + } + + @Override + protected void createDefaultZoneOnStartup() { + // There is no need to create a zone on start-up. + } + + @Override + protected void createDefaultTableOnStartup() { + // There is no need to create a table on start-up. + } + + /** + * Measures creating a new empty distribution zone. The word `empty` means that the zone has no tables. + */ + @Benchmark + @Threads(1) + @Warmup(iterations = 5, time = 5) + @Measurement(iterations = 5, time = 5) + @BenchmarkMode(AverageTime) + @OutputTimeUnit(MILLISECONDS) + public void createEmptyDistributionZone() { + ZoneDefinition zone = ZoneDefinition.builder("zone_test_" + cnt.incrementAndGet()) + .ifNotExists() Review Comment: On the one hand, this flag (I mean `ifNotExists`) looks harmless. On the other hand, it is useless because we create a new table using a unique name. I will remove this useless flag to avoid confusion. Thank you! -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org