You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/03/01 10:53:28 UTC

[camel-performance-tests] branch camel-3.x updated: Added threading scenarios to the Blocking seda tests

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

orpiske pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel-performance-tests.git


The following commit(s) were added to refs/heads/camel-3.x by this push:
     new 0c36bd6  Added threading scenarios to the Blocking seda tests
0c36bd6 is described below

commit 0c36bd6d99fd55d4edaef0cd58a016d0f0d8d7d9
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Mar 1 11:24:01 2023 +0100

    Added threading scenarios to the Blocking seda tests
---
 .../itest/jmh/BlockingProducerToSedaTest.java      | 24 ++++++++++++++++++++--
 ...ngProducerWithArrayBlockingQueueToSedaTest.java | 24 ++++++++++++++++++++--
 2 files changed, 44 insertions(+), 4 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 58586f3..f7c6ee6 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
@@ -17,6 +17,7 @@ import org.openjdk.jmh.annotations.OutputTimeUnit;
 import org.openjdk.jmh.annotations.Scope;
 import org.openjdk.jmh.annotations.Setup;
 import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Threads;
 import org.openjdk.jmh.infra.Blackhole;
 import org.openjdk.jmh.results.format.ResultFormatType;
 import org.openjdk.jmh.runner.Runner;
@@ -80,15 +81,34 @@ public class BlockingProducerToSedaTest {
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
     @Benchmark
-    public void sendBlocking(BlockingProducerToSedaTest.BenchmarkState state, Blackhole bh) {
+    public void sendBlocking(BenchmarkState state, Blackhole bh) {
         state.producerTemplate.sendBody(state.endpoint, "test");
     }
 
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    @Threads(6)
+    public void sendBlocking_4(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+    }
+
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    public void sendBlockingWithMultipleTypes(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+        state.producerTemplate.sendBody(state.endpoint, state.someInt);
+        state.producerTemplate.sendBody(state.endpoint, state.someLong);
+        state.producerTemplate.sendBody(state.endpoint, state.sampleFile);
+    }
 
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
     @Benchmark
-    public void sendBlockingWithMultipleTypes(BlockingProducerToSedaTest.BenchmarkState state, Blackhole bh) {
+    @Threads(6)
+    public void sendBlockingWithMultipleTypes_6(BenchmarkState state, Blackhole bh) {
         state.producerTemplate.sendBody(state.endpoint, "test");
         state.producerTemplate.sendBody(state.endpoint, state.someInt);
         state.producerTemplate.sendBody(state.endpoint, state.someLong);
diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/BlockingProducerWithArrayBlockingQueueToSedaTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/BlockingProducerWithArrayBlockingQueueToSedaTest.java
index 3779771..3576f70 100644
--- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/BlockingProducerWithArrayBlockingQueueToSedaTest.java
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/BlockingProducerWithArrayBlockingQueueToSedaTest.java
@@ -19,6 +19,7 @@ import org.openjdk.jmh.annotations.OutputTimeUnit;
 import org.openjdk.jmh.annotations.Scope;
 import org.openjdk.jmh.annotations.Setup;
 import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Threads;
 import org.openjdk.jmh.infra.Blackhole;
 import org.openjdk.jmh.results.format.ResultFormatType;
 import org.openjdk.jmh.runner.Runner;
@@ -83,15 +84,34 @@ public class BlockingProducerWithArrayBlockingQueueToSedaTest {
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
     @Benchmark
-    public void sendBlocking(BlockingProducerWithArrayBlockingQueueToSedaTest.BenchmarkState state, Blackhole bh) {
+    public void sendBlocking(BenchmarkState state, Blackhole bh) {
         state.producerTemplate.sendBody(state.endpoint, "test");
     }
 
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    @Threads(6)
+    public void sendBlocking_4(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+    }
+
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    public void sendBlockingWithMultipleTypes(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+        state.producerTemplate.sendBody(state.endpoint, state.someInt);
+        state.producerTemplate.sendBody(state.endpoint, state.someLong);
+        state.producerTemplate.sendBody(state.endpoint, state.sampleFile);
+    }
 
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
     @Benchmark
-    public void sendBlockingWithMultipleTypes(BlockingProducerWithArrayBlockingQueueToSedaTest.BenchmarkState state, Blackhole bh) {
+    @Threads(6)
+    public void sendBlockingWithMultipleTypes_6(BenchmarkState state, Blackhole bh) {
         state.producerTemplate.sendBody(state.endpoint, "test");
         state.producerTemplate.sendBody(state.endpoint, state.someInt);
         state.producerTemplate.sendBody(state.endpoint, state.someLong);