You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by df...@apache.org on 2021/04/20 18:31:29 UTC
[camel-performance-tests] 01/16: Initial camel performance
This is an automated email from the ASF dual-hosted git repository.
dfoulks pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-performance-tests.git
commit 4d788c3716103d2d26f2c1b00791a5b8250a62b6
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Mar 10 13:22:56 2021 +0100
Initial camel performance
---
.gitignore | 27 +++
pom.xml | 190 +++++++++++++++++++++
profiling/pom.xml | 41 +++++
profiling/timer-log/pom.xml | 94 ++++++++++
.../org/apache/camel/example/MyApplication.java | 38 +++++
.../org/apache/camel/example/MyRouteBuilder.java | 37 ++++
.../src/main/resources/application.properties | 32 ++++
profiling/timer-log/src/main/resources/logback.xml | 30 ++++
.../target/classes/application.properties | 32 ++++
profiling/timer-log/target/classes/logback.xml | 30 ++++
10 files changed, 551 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5d69a55
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,27 @@
+target
+*.iml
+*.ipr
+*.iws
+.idea
+.DS_Store
+.classpath
+.ekstazi
+.project
+.settings
+.checkstyle
+*.log
+test-salesforce-login.properties
+dependency-reduced-pom.xml
+id_file
+components/camel-solr/data
+*.epoch
+.factorypath
+.pmd
+.sts4-cache
+log-camel-lsp.out
+.vscode
+*.code-workspace
+components/camel-cxf/activemq-data
+*.swp
+.flattened-pom.xml
+.java-version
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..8bc7869
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-dependencies</artifactId>
+ <version>3.9.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.camel.tests</groupId>
+ <artifactId>camel-tests-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Camel Performance :: Parent</name>
+ <packaging>pom</packaging>
+ <description>Performance tests for Camel</description>
+ <url>https://camel.apache.org</url>
+
+ <developers>
+ <developer>
+ <name>The Apache Camel Team</name>
+ <email>dev@camel.apache.org</email>
+ <url>https://camel.apache.org</url>
+ <organization>Apache Software Foundation</organization>
+ <organizationUrl>http://apache.org/</organizationUrl>
+ </developer>
+ </developers>
+
+ <mailingLists>
+ <mailingList>
+ <name>Development List</name>
+ <subscribe>dev-subscribe@camel.apache.org</subscribe>
+ <unsubscribe>dev-unsubscribe@camel.apache.org</unsubscribe>
+ <post>dev@camel.apache.org</post>
+ </mailingList>
+ <mailingList>
+ <name>User List</name>
+ <subscribe>users-subscribe@camel.apache.org</subscribe>
+ <unsubscribe>users-unsubscribe@camel.apache.org</unsubscribe>
+ <post>users@camel.apache.org</post>
+ </mailingList>
+ <mailingList>
+ <name>Commits List</name>
+ <subscribe>commits-subscribe@camel.apache.org</subscribe>
+ <unsubscribe>commits-unsubscribe@camel.apache.org</unsubscribe>
+ <post>commits@camel.apache.org</post>
+ </mailingList>
+ </mailingLists>
+
+ <issueManagement>
+ <system>jira</system>
+ <url>https://issues.apache.org/jira/browse/CAMEL</url>
+ </issueManagement>
+
+ <distributionManagement>
+ <site>
+ <id>apache.website</id>
+ <url>${site-repo-url}</url>
+ </site>
+ </distributionManagement>
+
+ <modules>
+ <module>profiling</module>
+ </modules>
+
+ <properties>
+ <!-- unify the encoding for all the modules -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+ <site-repo-url>scpexe://people.apache.org/www/camel.apache.org/maven/</site-repo-url>
+ <jdk.version>1.8</jdk.version>
+ <compiler.fork>false</compiler.fork>
+
+ <camel.version>3.9.0-SNAPSHOT</camel.version>
+
+ <!-- Versions -->
+ <maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
+ <maven-surefire-plugin-version>3.0.0-M4</maven-surefire-plugin-version>
+ <maven-javadoc-plugin-version>3.0.1</maven-javadoc-plugin-version>
+ <exec-maven-plugin-version>1.6.0</exec-maven-plugin-version>
+ <surefire.version>${maven-surefire-plugin-version}</surefire.version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <url>https://repository.apache.org/snapshots/</url>
+ <name>Apache Snapshot Repo</name>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>apache.snapshots</id>
+ <url>https://repository.apache.org/snapshots/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkCount>1</forkCount>
+ <reuseForks>false</reuseForks>
+ <systemPropertyVariables>
+ <skipStartingCamelContext>${skip.starting.camel.context}</skipStartingCamelContext>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin-version}</version>
+ <configuration>
+ <source>${jdk.version}</source>
+ <target>${jdk.version}</target>
+ <maxmem>512M</maxmem>
+ <fork>${compiler.fork}</fork>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>process-resource-bundles</id>
+ <phase>disabled</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>${exec-maven-plugin-version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
diff --git a/profiling/pom.xml b/profiling/pom.xml
new file mode 100644
index 0000000..3ad9536
--- /dev/null
+++ b/profiling/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.tests</groupId>
+ <artifactId>camel-tests-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>profiling</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Camel Performance :: Profiling</name>
+
+ <modules>
+ <module>timer-log</module>
+ </modules>
+
+</project>
diff --git a/profiling/timer-log/pom.xml b/profiling/timer-log/pom.xml
new file mode 100644
index 0000000..4ae27ef
--- /dev/null
+++ b/profiling/timer-log/pom.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.apache.camel.tests</groupId>
+ <artifactId>profiling</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>timer-log</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Camel Performance :: Profiling :: Timer Log</name>
+ <description>A little example to profile Camel routing engine</description>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-main</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-log</artifactId>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <version>${logback-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback-version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- to run the application -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-maven-plugin</artifactId>
+ <version>${camel.version}</version>
+ <configuration>
+ <mainClass>org.apache.camel.example.MyApplication</mainClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/profiling/timer-log/src/main/java/org/apache/camel/example/MyApplication.java b/profiling/timer-log/src/main/java/org/apache/camel/example/MyApplication.java
new file mode 100644
index 0000000..496b37d
--- /dev/null
+++ b/profiling/timer-log/src/main/java/org/apache/camel/example/MyApplication.java
@@ -0,0 +1,38 @@
+/*
+ * 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.camel.example;
+
+import org.apache.camel.main.Main;
+
+/**
+ * Main class that boot the Camel application
+ */
+public final class MyApplication {
+
+ private MyApplication() {
+ }
+
+ public static void main(String[] args) throws Exception {
+ // use Camels Main class
+ Main main = new Main();
+ // and add the routes (you can specify multiple classes)
+ main.configure().addRoutesBuilder(MyRouteBuilder.class);
+ // now keep the application running until the JVM is terminated (ctrl + c or sigterm)
+ main.run(args);
+ }
+
+}
diff --git a/profiling/timer-log/src/main/java/org/apache/camel/example/MyRouteBuilder.java b/profiling/timer-log/src/main/java/org/apache/camel/example/MyRouteBuilder.java
new file mode 100644
index 0000000..fbe0965
--- /dev/null
+++ b/profiling/timer-log/src/main/java/org/apache/camel/example/MyRouteBuilder.java
@@ -0,0 +1,37 @@
+/*
+ * 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.camel.example;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class MyRouteBuilder extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ from("timer:foo?delay=10s&period={{myPeriod}}&includeMetadata=false")
+ .to("log:out0?level=OFF")
+ .to("log:out1?level=OFF")
+ .to("log:out2?level=OFF")
+ .to("log:out3?level=OFF")
+ .to("log:out4?level=OFF")
+ .to("log:out5?level=OFF")
+ .to("log:out6?level=OFF")
+ .to("log:out7?level=OFF")
+ .to("log:out8?level=OFF")
+ .to("log:out9?level=OFF");
+ }
+}
diff --git a/profiling/timer-log/src/main/resources/application.properties b/profiling/timer-log/src/main/resources/application.properties
new file mode 100644
index 0000000..c7d93cf
--- /dev/null
+++ b/profiling/timer-log/src/main/resources/application.properties
@@ -0,0 +1,32 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# to configure camel main
+# here you can configure options on camel main (see MainConfigurationProperties class)
+camel.main.name = MyTinyCamel
+
+# run in lightweight mode to be tiny as possible
+camel.main.lightweight = true
+
+camel.main.exchange-factory = pooled
+camel.main.exchange-factory-capacity = 25
+camel.main.exchange-factory-statistics-enabled = true
+
+camel.main.duration-max-seconds = 130
+
+# properties used in the route
+myPeriod = 1
diff --git a/profiling/timer-log/src/main/resources/logback.xml b/profiling/timer-log/src/main/resources/logback.xml
new file mode 100644
index 0000000..a798d0b
--- /dev/null
+++ b/profiling/timer-log/src/main/resources/logback.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <root level="INFO">
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration>
diff --git a/profiling/timer-log/target/classes/application.properties b/profiling/timer-log/target/classes/application.properties
new file mode 100644
index 0000000..c7d93cf
--- /dev/null
+++ b/profiling/timer-log/target/classes/application.properties
@@ -0,0 +1,32 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# to configure camel main
+# here you can configure options on camel main (see MainConfigurationProperties class)
+camel.main.name = MyTinyCamel
+
+# run in lightweight mode to be tiny as possible
+camel.main.lightweight = true
+
+camel.main.exchange-factory = pooled
+camel.main.exchange-factory-capacity = 25
+camel.main.exchange-factory-statistics-enabled = true
+
+camel.main.duration-max-seconds = 130
+
+# properties used in the route
+myPeriod = 1
diff --git a/profiling/timer-log/target/classes/logback.xml b/profiling/timer-log/target/classes/logback.xml
new file mode 100644
index 0000000..a798d0b
--- /dev/null
+++ b/profiling/timer-log/target/classes/logback.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <root level="INFO">
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration>