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 165e4317a19f651520211fdfb409ca77c4ac0a65 Author: Jiri Petrlik <[email protected]> AuthorDate: Wed Dec 1 09:44:37 2021 +0100 BAPL-2028 - Performance regression testing of PMML Kogito --- .../org/kie/kogito/benchmarks/framework/App.java | 12 +++++- .../kie/kogito/benchmarks/framework/Commands.java | 2 +- .../benchmarks/framework/HTTPRequestInfo.java | 32 ++++++++++++++- .../kie/kogito/benchmarks/framework/MvnCmds.java | 2 +- .../kogito/benchmarks/framework/URLContent.java | 4 +- .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../threshold.properties | 6 +++ .../benchmarks/PMMLClusteringQuarkusTest.java | 47 ++++++++++++++++++++++ .../benchmarks/PMMLClusteringSpringBootTest.java | 47 ++++++++++++++++++++++ .../kogito/benchmarks/PMMLForestQuarkusTest.java | 47 ++++++++++++++++++++++ .../benchmarks/PMMLForestSpringBootTest.java | 47 ++++++++++++++++++++++ .../kie/kogito/benchmarks/PMMLMineQuarkusTest.java | 47 ++++++++++++++++++++++ .../kogito/benchmarks/PMMLMineSpringBootTest.java | 47 ++++++++++++++++++++++ .../benchmarks/PMMLRegressionQuarkusTest.java | 47 ++++++++++++++++++++++ .../benchmarks/PMMLRegressionSpringBootTest.java | 47 ++++++++++++++++++++++ .../benchmarks/PMMLScorecardQuarkusTest.java | 47 ++++++++++++++++++++++ .../benchmarks/PMMLScorecardSpringBootTest.java | 47 ++++++++++++++++++++++ 25 files changed, 577 insertions(+), 5 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 b762e6c..9776d9b 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 @@ -32,10 +32,20 @@ public enum App { 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), + PMML_CLUSTERING_QUARKUS_JVM("pmml-kie-benchmarks-clustering-quarkus-mvn", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.PMML_QUARKUS, WhitelistLogLines.EVERYTHING), + PMML_FOREST_QUARKUS_JVM("pmml-kie-benchmarks-forest-quarkus-mvn", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.PMML_QUARKUS, WhitelistLogLines.EVERYTHING), + PMML_MINE_QUARKUS_JVM("pmml-kie-benchmarks-mine-quarkus-mvn", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.PMML_QUARKUS, WhitelistLogLines.EVERYTHING), + PMML_REGRESSION_QUARKUS_JVM("pmml-kie-benchmarks-regression-quarkus-mvn", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.PMML_QUARKUS, WhitelistLogLines.EVERYTHING), + PMML_SCORECARD_QUARKUS_JVM("pmml-kie-benchmarks-scorecard-quarkus-mvn", MvnCmds.QUARKUS_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.PMML_QUARKUS, 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_STP_SPRING_BOOT_JVM("stp-smarthouse-03-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.SMARTHOUSE_STP, WhitelistLogLines.EVERYTHING); + SMARTHOUSE_STP_SPRING_BOOT_JVM("stp-smarthouse-03-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx3G" }, URLContent.SMARTHOUSE_STP, WhitelistLogLines.EVERYTHING), + PMML_CLUSTERING_SPRING_BOOT("pmml-kie-benchmarks-clustering-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx2G" }, URLContent.PMML_SPRINGBOOT, WhitelistLogLines.EVERYTHING), + PMML_FOREST_SPRING_BOOT("pmml-kie-benchmarks-forest-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx2G" }, URLContent.PMML_SPRINGBOOT, WhitelistLogLines.EVERYTHING), + PMML_MINE_SPRING_BOOT("pmml-kie-benchmarks-mine-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx2G" }, URLContent.PMML_SPRINGBOOT, WhitelistLogLines.EVERYTHING), + PMML_REGRESSION_SPRING_BOOT("pmml-kie-benchmarks-regression-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx2G" }, URLContent.PMML_SPRINGBOOT, WhitelistLogLines.EVERYTHING), + PMML_SCORECARD_SPRING_BOOT("pmml-kie-benchmarks-scorecard-springboot", MvnCmds.SPRING_BOOT_JVM, new String[] { "-Xms1G", "-Xmx2G" }, URLContent.PMML_SPRINGBOOT, WhitelistLogLines.EVERYTHING),; public final String dir; public final MvnCmds mavenCommands; diff --git a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/Commands.java b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/Commands.java index 8ed9c8c..a9c3cd1 100644 --- a/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/Commands.java +++ b/kogito-benchmarks-framework/src/main/java/org/kie/kogito/benchmarks/framework/Commands.java @@ -200,7 +200,7 @@ public class Commands { appendlnSection(whatIDidReport, String.join(" ", cmd)); Process pA = runCommand(cmd, appDir, runLogA); // Test web pages - long timeToFirstOKRequest = WebpageTester.testWeb(app.urlContent.urlContent[0][0], 10, app.urlContent.urlContent[0][1], true); + long timeToFirstOKRequest = WebpageTester.testWeb(app.urlContent.urlContent[0][0], 180, app.urlContent.urlContent[0][1], true); logger.info("Testing web page content..."); for (String[] urlContent : app.urlContent.urlContent) { WebpageTester.testWeb(urlContent[0], 5, urlContent[1], false); 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 aa85a56..118eaaf 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 @@ -221,6 +221,36 @@ public class HTTPRequestInfo { " \"threshold_high\": 0\n" + " }\n" + "}"; - } + public static final String PMML_CLUSTERING = "{\n" + + " \"sepal_length\": 7.9,\n" + + " \"sepal_width\": 4.4,\n" + + " \"petal_length\": 6.9,\n" + + " \"petal_width\": 2.5\n" + + "}"; + + public static final String PMML_FOREST = "{\n" + + " \"Age\": 21.0,\n" + + " \"MonthlySalary\": 10000.0,\n" + + " \"TotalAsset\": 10000.0,\n" + + " \"TotalRequired\": 15000.0,\n" + + " \"NumberInstallments\": 1.0\n" + + "}"; + + public static final String PMML_MINE = "{\n" + + " \"temperature\": 30.0,\n" + + " \"humidity\": 20.0\n" + + "}"; + + public static final String PMML_REGRESSION = "{\n" + + " \"age\": 0,\n" + + " \"salary\": 0,\n" + + " \"car_location\": \"carpark\"\n" + + "}"; + + public static final String PMML_SCORECARD = "{\n" + + " \"input1\": 0.0,\n" + + " \"input2\": 0.0\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 a6800a4..a89c77f 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 @@ -27,7 +27,7 @@ public enum MvnCmds { }), SPRING_BOOT_JVM(new String[][] { new String[] { "mvn", "clean", "package" }, // The JAR name is unified by setting finalName in the kie-assets-library repo - new String[] { "java", Placeholders.JVM_ARGS, "-jar", "target/smarthouse.jar" } + new String[] { "java", Placeholders.JVM_ARGS, "-jar", "target/runner.jar" } }), // These are not used now but may be useful in the future 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 0f42412..cc0cb48 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 @@ -19,7 +19,9 @@ 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_STP(new String[][] { new String[] { "http://localhost:8080/heating", "name=\"heating\"" }, - new String[] { "http://localhost:8080/smartHouse", "[]" } }); + new String[] { "http://localhost:8080/smartHouse", "[]" } }), + PMML_QUARKUS(new String[][] { new String[] { "http://localhost:8080/q/health/ready", "UP" } }), + PMML_SPRINGBOOT(new String[][] { new String[] { "http://localhost:8080/actuator/health", "UP" } }); public final String[][] urlContent; diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-clustering-quarkus-mvn/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-clustering-quarkus-mvn/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-clustering-quarkus-mvn/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-clustering-springboot/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-clustering-springboot/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-clustering-springboot/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-forest-quarkus-mvn/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-forest-quarkus-mvn/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-forest-quarkus-mvn/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-forest-springboot/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-forest-springboot/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-forest-springboot/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-mine-quarkus-mvn/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-mine-quarkus-mvn/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-mine-quarkus-mvn/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-mine-springboot/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-mine-springboot/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-mine-springboot/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-regression-quarkus-mvn/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-regression-quarkus-mvn/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-regression-quarkus-mvn/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-regression-springboot/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-regression-springboot/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-regression-springboot/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-scorecard-quarkus-mvn/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-scorecard-quarkus-mvn/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-scorecard-quarkus-mvn/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-scorecard-springboot/threshold.properties b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-scorecard-springboot/threshold.properties new file mode 100644 index 0000000..35ec0ee --- /dev/null +++ b/kogito-benchmarks-framework/src/main/resources/pmml-kie-benchmarks-scorecard-springboot/threshold.properties @@ -0,0 +1,6 @@ +linux.jvm.time.to.first.ok.request.threshold.ms=34000 +linux.jvm.RSS.threshold.kB=3800000 +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 +windows.jvm.RSS.threshold.kB=4000 diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLClusteringQuarkusTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLClusteringQuarkusTest.java new file mode 100644 index 0000000..5d2bee4 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLClusteringQuarkusTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLClusteringQuarkusTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_CLUSTERING_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 + "/SingleIrisKMeansClustering") + .body(HTTPRequestInfo.Body.PMML_CLUSTERING) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLClusteringSpringBootTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLClusteringSpringBootTest.java new file mode 100644 index 0000000..635dfc0 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLClusteringSpringBootTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLClusteringSpringBootTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_CLUSTERING_SPRING_BOOT; + + @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 + "/SingleIrisKMeansClustering") + .body(HTTPRequestInfo.Body.PMML_CLUSTERING) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLForestQuarkusTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLForestQuarkusTest.java new file mode 100644 index 0000000..4e28693 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLForestQuarkusTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLForestQuarkusTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_FOREST_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 + "/RandomForest") + .body(HTTPRequestInfo.Body.PMML_FOREST) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLForestSpringBootTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLForestSpringBootTest.java new file mode 100644 index 0000000..309327e --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLForestSpringBootTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLForestSpringBootTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_FOREST_SPRING_BOOT; + + @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 + "/RandomForest") + .body(HTTPRequestInfo.Body.PMML_FOREST) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLMineQuarkusTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLMineQuarkusTest.java new file mode 100644 index 0000000..126eb16 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLMineQuarkusTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLMineQuarkusTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_MINE_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 + "/SampleMineTreeModelWithTransformations") + .body(HTTPRequestInfo.Body.PMML_MINE) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLMineSpringBootTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLMineSpringBootTest.java new file mode 100644 index 0000000..aeb50d2 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLMineSpringBootTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLMineSpringBootTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_MINE_SPRING_BOOT; + + @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 + "/SampleMineTreeModelWithTransformations") + .body(HTTPRequestInfo.Body.PMML_MINE) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLRegressionQuarkusTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLRegressionQuarkusTest.java new file mode 100644 index 0000000..a9cc640 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLRegressionQuarkusTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLRegressionQuarkusTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_REGRESSION_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 + "/LinearRegressionSampleWithTransformations") + .body(HTTPRequestInfo.Body.PMML_REGRESSION) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLRegressionSpringBootTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLRegressionSpringBootTest.java new file mode 100644 index 0000000..4e7d190 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLRegressionSpringBootTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLRegressionSpringBootTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_REGRESSION_SPRING_BOOT; + + @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 + "/LinearRegressionSampleWithTransformations") + .body(HTTPRequestInfo.Body.PMML_REGRESSION) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLScorecardQuarkusTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLScorecardQuarkusTest.java new file mode 100644 index 0000000..2ef47b8 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLScorecardQuarkusTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLScorecardQuarkusTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_SCORECARD_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 + "/SimpleScorecardWithTransformations") + .body(HTTPRequestInfo.Body.PMML_SCORECARD) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} diff --git a/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLScorecardSpringBootTest.java b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLScorecardSpringBootTest.java new file mode 100644 index 0000000..e12c157 --- /dev/null +++ b/kogito-benchmarks-tests/src/test/java/org/kie/kogito/benchmarks/PMMLScorecardSpringBootTest.java @@ -0,0 +1,47 @@ +/* + * 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 PMMLScorecardSpringBootTest extends AbstractTemplateTest { + + private static final App APP_TO_TEST = App.PMML_SCORECARD_SPRING_BOOT; + + @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 + "/SimpleScorecardWithTransformations") + .body(HTTPRequestInfo.Body.PMML_SCORECARD) + .method("POST") + .header("Accept", "application/json") + .header("Content-Type", "application/json") + .expectedResponseStatusCode(200) + .build(); + + loadTest(testInfo, APP_TO_TEST, requestInfo); + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
