This is an automated email from the ASF dual-hosted git repository. kbowers pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-benchmarks.git
commit 6c4ecd13fc3392d6e80932855f6992caa1c12417 Author: Marián Macik <[email protected]> AuthorDate: Tue Nov 2 17:38:56 2021 +0100 KOGITO-6234 - Performance regression testing of BPMN Kogito straight-through processes (2nd level) --- .../org/kie/kogito/benchmarks/framework/App.java | 8 +-- .../benchmarks/framework/HTTPRequestInfo.java | 63 ++++++++++++++++++++++ .../kie/kogito/benchmarks/framework/MvnCmds.java | 2 +- .../kogito/benchmarks/framework/URLContent.java | 4 +- .../threshold.properties | 0 .../threshold.properties | 0 .../threshold.properties | 0 .../threshold.properties | 4 +- .../benchmarks/SmartHouseSTPQuarkusTest.java | 48 +++++++++++++++++ .../benchmarks/SmartHouseSTPSpringBootTest.java | 48 +++++++++++++++++ 10 files changed, 170 insertions(+), 7 deletions(-) diff --git a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/App.java b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/App.java index 5984347..b762e6c 100644 --- a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/App.java +++ b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/App.java @@ -29,11 +29,13 @@ import org.apache.commons.lang3.StringUtils; import static org.kie.kogito.benchmarks.framework.Commands.APPS_DIR; public enum App { - SMARTHOUSE_02_QUARKUS_JVM("smarthouse-02-quarkus", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx2G" }, URLContent.SMARTHOUSE_02, WhitelistLogLines.EVERYTHING), - SMARTHOUSE_03_QUARKUS_JVM("smarthouse-03-quarkus", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.SMARTHOUSE_03, WhitelistLogLines.EVERYTHING), + SMARTHOUSE_02_QUARKUS_JVM("smarthouse-02-quarkus-mvn", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx2G" }, URLContent.SMARTHOUSE_02, WhitelistLogLines.EVERYTHING), + SMARTHOUSE_03_QUARKUS_JVM("smarthouse-03-quarkus-mvn", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.SMARTHOUSE_03, WhitelistLogLines.EVERYTHING), + SMARTHOUSE_STP_QUARKUS_JVM("stp-smarthouse-03-quarkus-mvn", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.SMARTHOUSE_STP, WhitelistLogLines.EVERYTHING), SMARTHOUSE_02_SPRING_BOOT("smarthouse-02-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx2G" }, URLContent.SMARTHOUSE_02, WhitelistLogLines.EVERYTHING), - SMARTHOUSE_03_SPRING_BOOT("smarthouse-03-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.SMARTHOUSE_03, WhitelistLogLines.EVERYTHING); + SMARTHOUSE_03_SPRING_BOOT("smarthouse-03-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.SMARTHOUSE_03, WhitelistLogLines.EVERYTHING), + SMARTHOUSE_STP_SPRING_BOOT_JVM("stp-smarthouse-03-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.SMARTHOUSE_STP, WhitelistLogLines.EVERYTHING); public final String dir; public final MvnCmds mavenCommands; diff --git a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/HTTPRequestInfo.java b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/HTTPRequestInfo.java index c5a236c..aa85a56 100644 --- a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/HTTPRequestInfo.java +++ b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/HTTPRequestInfo.java @@ -158,6 +158,69 @@ public class HTTPRequestInfo { " }\n" + " ]\n" + "}"; + + public static final String SMARTHOUSE_BPMN_DMN = "{\n" + + " \"sensorsTemperature\": [\n" + + " {\n" + + " \"placement\": \"OUTSIDE\",\n" + + " \"current\": 25,\n" + + " \"previous\": [\n" + + " 24,\n" + + " 23,\n" + + " 19,\n" + + " 16,\n" + + " 15,\n" + + " 11\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"placement\": \"INSIDE\",\n" + + " \"current\": 24.9,\n" + + " \"previous\": [\n" + + " 25,\n" + + " 28,\n" + + " 28,\n" + + " 28,\n" + + " 28,\n" + + " 28\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"sensorsHumidity\": [\n" + + " {\n" + + " \"placement\": \"OUTSIDE\",\n" + + " \"current\": 0,\n" + + " \"previous\": [\n" + + " 0,\n" + + " 0,\n" + + " 0,\n" + + " 0,\n" + + " 0,\n" + + " 0\n" + + " ]\n" + + " },\n" + + " {\n" + + " \"placement\": \"INSIDE\",\n" + + " \"current\": 0,\n" + + " \"previous\": [\n" + + " 0,\n" + + " 0,\n" + + " 0,\n" + + " 0,\n" + + " 0,\n" + + " 0\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"settingsTemperature\": {\n" + + " \"threshold_low\": 21,\n" + + " \"threshold_high\": 24\n" + + " },\n" + + " \"settingsHumidity\": {\n" + + " \"threshold_low\": 0,\n" + + " \"threshold_high\": 0\n" + + " }\n" + + "}"; } } diff --git a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/MvnCmds.java b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/MvnCmds.java index 8b40b3b..a6800a4 100644 --- a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/MvnCmds.java +++ b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/MvnCmds.java @@ -23,7 +23,7 @@ import static org.kie.kogito.benchmarks.framework.Commands.getQuarkusNativePrope public enum MvnCmds { QUARKUS_JVM(new String[][] { new String[] { "mvn", "clean", "package", "-Dquarkus.package.output-name=quarkus" }, - new String[] { "java", Placeholders.JVM_ARGS, "-jar", "target/quarkus-runner.jar" } + new String[] { "java", Placeholders.JVM_ARGS, "-jar", "target/quarkus-app/quarkus-run.jar" } }), SPRING_BOOT_JVM(new String[][] { new String[] { "mvn", "clean", "package" }, // The JAR name is unified by setting finalName in the kie-assets-library repo diff --git a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/URLContent.java b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/URLContent.java index 5de9107..0f42412 100644 --- a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/URLContent.java +++ b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/URLContent.java @@ -17,7 +17,9 @@ package org.kie.kogito.benchmarks.framework; public enum URLContent { SMARTHOUSE_02(new String[][] { new String[] { "http://localhost:8080/heating", "name=\"heating\"" } }), - SMARTHOUSE_03(new String[][] { new String[] { "http://localhost:8080/heating", "name=\"heating\"" } }); + SMARTHOUSE_03(new String[][] { new String[] { "http://localhost:8080/heating", "name=\"heating\"" } }), + SMARTHOUSE_STP(new String[][] { new String[] { "http://localhost:8080/heating", "name=\"heating\"" }, + new String[] { "http://localhost:8080/smartHouse", "[]" } }); public final String[][] urlContent; diff --git a/kogito-benchmarks-framework/src/main/resources/smarthouse-02-quarkus/threshold.properties b/kogito-benchmarks-framework/src/main/resources/smarthouse-02-quarkus-mvn/threshold.properties similarity index 100% copy from kogito-benchmarks-framework/src/main/resources/smarthouse-02-quarkus/threshold.properties copy to kogito-benchmarks-framework/src/main/resources/smarthouse-02-quarkus-mvn/threshold.properties diff --git a/kogito-benchmarks-framework/src/main/resources/smarthouse-03-quarkus/threshold.properties b/kogito-benchmarks-framework/src/main/resources/smarthouse-03-quarkus-mvn/threshold.properties similarity index 100% copy from kogito-benchmarks-framework/src/main/resources/smarthouse-03-quarkus/threshold.properties copy to kogito-benchmarks-framework/src/main/resources/smarthouse-03-quarkus-mvn/threshold.properties diff --git a/kogito-benchmarks-framework/src/main/resources/smarthouse-03-quarkus/threshold.properties b/kogito-benchmarks-framework/src/main/resources/stp-smarthouse-03-quarkus-mvn/threshold.properties similarity index 100% rename from kogito-benchmarks-framework/src/main/resources/smarthouse-03-quarkus/threshold.properties rename to kogito-benchmarks-framework/src/main/resources/stp-smarthouse-03-quarkus-mvn/threshold.properties diff --git a/kogito-benchmarks-framework/src/main/resources/smarthouse-02-quarkus/threshold.properties b/kogito-benchmarks-framework/src/main/resources/stp-smarthouse-03-springboot/threshold.properties similarity index 67% rename from kogito-benchmarks-framework/src/main/resources/smarthouse-02-quarkus/threshold.properties rename to kogito-benchmarks-framework/src/main/resources/stp-smarthouse-03-springboot/threshold.properties index 36c0c1c..91cd28f 100644 --- a/kogito-benchmarks-framework/src/main/resources/smarthouse-02-quarkus/threshold.properties +++ b/kogito-benchmarks-framework/src/main/resources/stp-smarthouse-03-springboot/threshold.properties @@ -1,5 +1,5 @@ -linux.jvm.time.to.first.ok.request.threshold.ms=3400 -linux.jvm.RSS.threshold.kB=380000 +linux.jvm.time.to.first.ok.request.threshold.ms=6000 +linux.jvm.RSS.threshold.kB=800000 linux.native.time.to.first.ok.request.threshold.ms=35 linux.native.RSS.threshold.kB=90000 windows.jvm.time.to.first.ok.request.threshold.ms=2000 diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/SmartHouseSTPQuarkusTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/SmartHouseSTPQuarkusTest.java new file mode 100644 index 0000000..87fdf55 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/SmartHouseSTPQuarkusTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2021 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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.kie.kogito.benchmarks; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.kie.kogito.benchmarks.framework.App; +import org.kie.kogito.benchmarks.framework.HTTPRequestInfo; + +public class SmartHouseSTPQuarkusTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.SMARTHOUSE_STP_QUARKUS_JVM; + + @Test + public void startStop(TestInfo testInfo) throws IOException, InterruptedException { + startStop(testInfo, APP_TO_TEST); + } + + @Test + public void loadTest(TestInfo testInfo) throws IOException, InterruptedException { + HTTPRequestInfo requestInfo = HTTPRequestInfo.builder() + .URI(LOCALHOST + "/smartHouse") + .body(HTTPRequestInfo.Body.SMARTHOUSE_BPMN_DMN) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(201) + .build(); // This may be directly replaced for example by Apache-specific class, but this keeps + // it detached from any framework + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/SmartHouseSTPSpringBootTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/SmartHouseSTPSpringBootTest.java new file mode 100644 index 0000000..f7b1616 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/SmartHouseSTPSpringBootTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2021 Red Hat, Inc. and/or its affiliates. + * + * Licensed 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.kie.kogito.benchmarks; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.kie.kogito.benchmarks.framework.App; +import org.kie.kogito.benchmarks.framework.HTTPRequestInfo; + +public class SmartHouseSTPSpringBootTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.SMARTHOUSE_STP_SPRING_BOOT_JVM; + + @Test + public void startStop(TestInfo testInfo) throws IOException, InterruptedException { + startStop(testInfo, APP_TO_TEST); + } + + @Test + public void loadTest(TestInfo testInfo) throws IOException, InterruptedException { + HTTPRequestInfo requestInfo = HTTPRequestInfo.builder() + .URI(LOCALHOST + "/smartHouse") + .body(HTTPRequestInfo.Body.SMARTHOUSE_BPMN_DMN) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(201) + .build(); // This may be directly replaced for example by Apache-specific class, but this keeps + // it detached from any framework + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
