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/05/04 05:30:13 UTC

[camel-performance-tests] branch main updated (b176d1c -> d6d6839)

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

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


    from b176d1c  (chores) Cleanup DefaultUUIDGenerator Test
     new bb8339a  (chores) performance: added new test for the Disruptor component
     new d6d6839  (chores) performance: fixed naming inconsistencies in Seda tests

The 2 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:
 .../itest/jmh/BlockingProducerToSedaTest.java      |   2 +-
 ...ngProducerWithArrayBlockingQueueToSedaTest.java |   2 +-
 ...eToSedaTest.java => DisruptorProducerTest.java} | 100 +++++++++++++++++----
 3 files changed, 87 insertions(+), 17 deletions(-)
 copy tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/{BlockingProducerWithArrayBlockingQueueToSedaTest.java => DisruptorProducerTest.java} (50%)


[camel-performance-tests] 02/02: (chores) performance: fixed naming inconsistencies in Seda tests

Posted by or...@apache.org.
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 d6d68399a58c889ff6f670128dcceb9c1ff1191e
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu May 4 07:29:50 2023 +0200

    (chores) performance: fixed naming inconsistencies in Seda tests
---
 .../java/org/apache/camel/itest/jmh/BlockingProducerToSedaTest.java     | 2 +-
 .../itest/jmh/BlockingProducerWithArrayBlockingQueueToSedaTest.java     | 2 +-
 2 files changed, 2 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 f7c6ee6..e20f2e6 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
@@ -89,7 +89,7 @@ public class BlockingProducerToSedaTest {
     @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
     @Benchmark
     @Threads(6)
-    public void sendBlocking_4(BenchmarkState state, Blackhole bh) {
+    public void sendBlocking_6(BenchmarkState state, Blackhole bh) {
         state.producerTemplate.sendBody(state.endpoint, "test");
     }
 
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 3576f70..57db655 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
@@ -92,7 +92,7 @@ public class BlockingProducerWithArrayBlockingQueueToSedaTest {
     @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
     @Benchmark
     @Threads(6)
-    public void sendBlocking_4(BenchmarkState state, Blackhole bh) {
+    public void sendBlocking_6(BenchmarkState state, Blackhole bh) {
         state.producerTemplate.sendBody(state.endpoint, "test");
     }
 


[camel-performance-tests] 01/02: (chores) performance: added new test for the Disruptor component

Posted by or...@apache.org.
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 bb8339a59d1591aaa38ac856c2a7c9c0f464c27a
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu May 4 07:26:29 2023 +0200

    (chores) performance: added new test for the Disruptor component
---
 .../camel/itest/jmh/DisruptorProducerTest.java     | 192 +++++++++++++++++++++
 1 file changed, 192 insertions(+)

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
new file mode 100644
index 0000000..e98e580
--- /dev/null
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/DisruptorProducerTest.java
@@ -0,0 +1,192 @@
+package org.apache.camel.itest.jmh;
+
+import java.io.File;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.junit.jupiter.api.Test;
+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.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;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+public class DisruptorProducerTest {
+
+    @Test
+    public void launchBenchmark() throws Exception {
+        Options opt = new OptionsBuilder()
+                // Specify which benchmarks to run.
+                // You can be more specific if you'd like to run only one benchmark per test.
+                .include(this.getClass().getName() + ".*")
+                // Set the following options as needed
+                .measurementIterations(10)
+                .warmupIterations(5)
+                .forks(1)
+                .resultFormat(ResultFormatType.JSON)
+                .result(this.getClass().getSimpleName() + ".jmh.json")
+                .build();
+
+        new Runner(opt).run();
+    }
+
+    // The JMH samples are the best documentation for how to use it
+    // 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 {
+
+        CamelContext context;
+        ProducerTemplate producerTemplate;
+        Endpoint endpoint;
+
+        File sampleFile = new File("some-file");
+        Integer someInt = Integer.valueOf(1);
+        Long someLong = Long.valueOf(2);
+
+        @Setup(Level.Trial)
+        public void initialize() throws Exception {
+            context = new DefaultCamelContext();
+
+            producerTemplate = context.createProducerTemplate();
+            endpoint = context.getEndpoint("disruptor:test");
+
+            context.addRoutes(new RouteBuilder() {
+                @Override
+                public void configure() {
+                    fromF("disruptor:test").to("log:?level=OFF");
+
+                }
+            });
+
+            context.start();
+        }
+    }
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    public void send_1(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+    }
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    @Threads(2)
+    public void send_2(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+    }
+
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    @Threads(4)
+    public void send_4(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+    }
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    @Threads(8)
+    public void send_8(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+    }
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    @Threads(16)
+    public void send_16(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+    }
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    @Threads(32)
+    public void send_32(BenchmarkState state, Blackhole bh) {
+        state.producerTemplate.sendBody(state.endpoint, "test");
+    }
+
+
+    @OutputTimeUnit(TimeUnit.MILLISECONDS)
+    @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SingleShotTime})
+    @Benchmark
+    public void sendMultipleTypes_1(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
+    @Threads(2)
+    public void sendBlockingWithMultipleTypes_2(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
+    @Threads(4)
+    public void sendBlockingWithMultipleTypes_4(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
+    @Threads(8)
+    public void sendBlockingWithMultipleTypes_8(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
+    @Threads(16)
+    public void sendBlockingWithMultipleTypes_16(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
+    @Threads(32)
+    public void sendBlockingWithMultipleTypes_32(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);
+    }
+}