This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-performance-tests.git
commit be725fbe1278624f04687ef4f5c51d84d05106ba Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Thu May 4 07:43:17 2023 +0200 (chores) performance: allow a different number of consumers for some seda and disruptor tests --- .../java/org/apache/camel/itest/jmh/BlockingProducerToSedaTest.java | 5 ++++- .../test/java/org/apache/camel/itest/jmh/DisruptorProducerTest.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/BlockingProducerToSedaTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/BlockingProducerToSedaTest.java index e20f2e6..e8df3c0 100644 --- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/BlockingProducerToSedaTest.java +++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/BlockingProducerToSedaTest.java @@ -14,6 +14,7 @@ import org.openjdk.jmh.annotations.BenchmarkMode; 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; @@ -47,6 +48,8 @@ public class BlockingProducerToSedaTest { // http://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/ @State(Scope.Benchmark) public static class BenchmarkState { + @Param({"1", "2", "4", "8", "16", "32"}) + int consumers; CamelContext context; ProducerTemplate producerTemplate; @@ -69,7 +72,7 @@ public class BlockingProducerToSedaTest { onException(IllegalStateException.class) .process(e -> System.out.println("The SEDA queue is likely full and the system may be unable to catch to the load. Fix the test parameters")); - fromF("seda:test").to("log:?level=OFF"); + fromF("seda:test?concurrentConsumers=%s", consumers).to("log:?level=OFF"); } }); diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/DisruptorProducerTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/DisruptorProducerTest.java index e98e580..6b6898b 100644 --- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/DisruptorProducerTest.java +++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/DisruptorProducerTest.java @@ -14,6 +14,7 @@ import org.openjdk.jmh.annotations.BenchmarkMode; 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; @@ -47,6 +48,8 @@ public class DisruptorProducerTest { // http://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/ @State(Scope.Benchmark) public static class BenchmarkState { + @Param({"1", "2", "4", "8", "16", "32"}) + int consumers; CamelContext context; ProducerTemplate producerTemplate; @@ -66,7 +69,7 @@ public class DisruptorProducerTest { context.addRoutes(new RouteBuilder() { @Override public void configure() { - fromF("disruptor:test").to("log:?level=OFF"); + fromF("disruptor:test?concurrentConsumers=%s", consumers).to("log:?level=OFF"); } });