diff --git a/src/main/java/fi/utu/tech/powergoblin/api/web/Webserver.kt b/src/main/java/fi/utu/tech/powergoblin/api/web/Webserver.kt index c133710ee1f06dea38a122d932f3aa7819e7b639..30db0f086dc6a1b98ecd6e5e59464c304c285be2 100644 --- a/src/main/java/fi/utu/tech/powergoblin/api/web/Webserver.kt +++ b/src/main/java/fi/utu/tech/powergoblin/api/web/Webserver.kt @@ -16,6 +16,7 @@ import java.nio.file.Files import java.nio.file.Path import java.time.LocalDateTime import java.util.concurrent.ConcurrentLinkedQueue +import java.util.concurrent.Executors import java.util.concurrent.Future import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicInteger @@ -121,6 +122,7 @@ open class SimpleWebServer( IO.printBold("Web [$this] listening at [ http://${it.address}:${it.port} ]") } IO.printBold("") + //server.setExecutor(Executors.newVirtualThreadPerTaskExecutor()) server.createContext("/") { httpExchange: HttpExchange -> if (!active) throw Exception("Server closed the connection") diff --git a/stuff/client-library/test.sh b/stuff/client-library/test.sh index e7a60e91f3d8cf9d6c0ab3f6889dfa703bf77569..c0302fa1ad6176c00283f75840103983ae87e7d6 100755 --- a/stuff/client-library/test.sh +++ b/stuff/client-library/test.sh @@ -1,6 +1,12 @@ #!/bin/bash -set +x +die() { + echo $* + exit 1 +} + +[ -e powergoblin.sh ] || die powergoblin.sh missing + source powergoblin.sh export HOST=localhost:8080 diff --git a/stuff/collectd-example/README.md b/stuff/collectd-example/README.md index 9c8368755bbc0b6b2d5bd4909961c7db415a7f93..a748db6225354217ce7603dd0ceb7867b8286fb1 100644 --- a/stuff/collectd-example/README.md +++ b/stuff/collectd-example/README.md @@ -29,6 +29,6 @@ $ ./collect.sh You will need to customize the script to suit your needs. In the beginning of the file, there are parameters for configuring names, number of runs, and -other settings. The actual code that will be measured is located on lines 28 -and 46. +other settings. The actual code that will be measured is located on lines 35 +and 53. diff --git a/stuff/collectd-example/collect.sh b/stuff/collectd-example/collect.sh index 8d78de9727dde4d3fc8cc107ec36739c06792ed8..6bd0c6d8a66b185979e99e5b5a1d258cf7ec0164 100755 --- a/stuff/collectd-example/collect.sh +++ b/stuff/collectd-example/collect.sh @@ -2,6 +2,13 @@ # You can use this as a template for your measurements. # This depends on the `powergoblin.sh` in `client-library/` +die() { + echo $* + exit 1 +} + +[ -e powergoblin.sh ] || die powergoblin.sh missing + source powergoblin.sh export HOST=localhost:8080 diff --git a/stuff/collectd-nvml/README.md b/stuff/collectd-nvml/README.md index deb451ae73b8c442c2113fe53637f4d788cd79c6..3d77dac8ceeb70e0035bcfccf4eee647d37e56a6 100644 --- a/stuff/collectd-nvml/README.md +++ b/stuff/collectd-nvml/README.md @@ -31,6 +31,6 @@ $ ./collect.sh You will need to customize the script to suit your needs. In the beginning of the file, there are parameters for configuring names, number of runs, and -other settings. The actual code that will be measured is located on lines 29 -and 47. +other settings. The actual code that will be measured is located on lines 36 +and 54. diff --git a/stuff/collectd-nvml/collect.sh b/stuff/collectd-nvml/collect.sh index 40cf6de00e0539a427e71d8cff1851d3cf8dfc91..4e493d663d588f5dc3353bee486be277d25065da 100755 --- a/stuff/collectd-nvml/collect.sh +++ b/stuff/collectd-nvml/collect.sh @@ -2,6 +2,13 @@ # You can use this as a template for your measurements. # This depends on the `powergoblin.sh` in `client-library/` +die() { + echo $* + exit 1 +} + +[ -e powergoblin.sh ] || die powergoblin.sh missing + source powergoblin.sh export HOST=localhost:8080 diff --git a/stuff/collectd-rapl/README.md b/stuff/collectd-rapl/README.md index edd669feda1394d70f01dc2dd0dcffac4b79542a..81962937f3bb19119d3c3cedc387e19ad1ba9245 100644 --- a/stuff/collectd-rapl/README.md +++ b/stuff/collectd-rapl/README.md @@ -33,6 +33,6 @@ $ ./collect.sh You will need to customize the script to suit your needs. In the beginning of the file, there are parameters for configuring names, number of runs, and -other settings. The actual code that will be measured is located on lines 29 -and 47. +other settings. The actual code that will be measured is located on lines 36 +and 54. diff --git a/stuff/collectd-rapl/collect.sh b/stuff/collectd-rapl/collect.sh index 5a0aae53a2b579fe88936aa7bc65a78ec792fc11..37cd7802d27bf15e533a45e0b1cbd182030ac45f 100755 --- a/stuff/collectd-rapl/collect.sh +++ b/stuff/collectd-rapl/collect.sh @@ -2,6 +2,13 @@ # You can use this as a template for your measurements. # This depends on the `powergoblin.sh` in `client-library/` +die() { + echo $* + exit 1 +} + +[ -e powergoblin.sh ] || die powergoblin.sh missing + source powergoblin.sh export HOST=localhost:8080 diff --git a/stuff/fullstack-example/README.md b/stuff/fullstack-example/README.md index 8dccd053740ea1340c29a123e38dfaa37e200678..5e413e7787d19af926b2aacb0e19624356b7e60d 100644 --- a/stuff/fullstack-example/README.md +++ b/stuff/fullstack-example/README.md @@ -21,8 +21,8 @@ $ mvn io.quarkus.platform:quarkus-maven-plugin:3.23.0:create \ Machines (hostname / IP): * controller: 192.168.1.10 -* sut-frontend: 192.168.1.20 -* sut-backend: 192.168.1.30 +* sut-front: 192.168.1.20 +* sut-back: 192.168.1.30 Preparations (background shell, run on `controller`): diff --git a/stuff/fullstack-example/mscript.sh b/stuff/fullstack-example/mscript.sh new file mode 100755 index 0000000000000000000000000000000000000000..dc1540d709b3bd886452703bb02bc86a555e8eaf --- /dev/null +++ b/stuff/fullstack-example/mscript.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +export BACKEND=sut-back:8080 +export POWERGOBLIN=controller:8888 +docker run -e POWERGOBLIN=$POWERGOBLIN --network host fullstack-example:latest +python test-backend.py \ No newline at end of file diff --git a/stuff/fullstack-example/src/main/java/org/acme/MeasuredHashResource.java b/stuff/fullstack-example/src/main/java/org/acme/MeasuredHashResource.java index 160637137ad5b13dc4a98d2fbdcf4ca4aa830ddf..f85d3f089c7185fec7c251683c8abceab5d58cf5 100644 --- a/stuff/fullstack-example/src/main/java/org/acme/MeasuredHashResource.java +++ b/stuff/fullstack-example/src/main/java/org/acme/MeasuredHashResource.java @@ -34,7 +34,7 @@ public class MeasuredHashResource { pg.get("session/latest/measurement/start"); pg.get("session/latest/measurement/rename/Whitebox"); - for (int j=0;j<10;j++) { + for (int j = 0; j < 10; j++) { pg.get("session/latest/run/start"); for (int i = 0; i < 50; i++) diff --git a/stuff/fullstack-example/src/main/java/org/acme/PageResource.java b/stuff/fullstack-example/src/main/java/org/acme/PageResource.java index 7a5ccda15ca68fbdcaf7ac223144eee76d32c6cb..fd9a4e916f12034ef78790554edec4cef7859dd8 100644 --- a/stuff/fullstack-example/src/main/java/org/acme/PageResource.java +++ b/stuff/fullstack-example/src/main/java/org/acme/PageResource.java @@ -10,16 +10,16 @@ import java.nio.charset.StandardCharsets; /** * This page contains Javascript variables that will be extracted * by a Selenium script: - * - * - const banana = 42; - * - const strawberry = 123; - * + * <p> + * - const banana = 42; + * - const strawberry = 123; + * <p> * Various resource information could be obtained with the same technique. */ @Path("/page") public class PageResource { String readPage() { - try(var is = getClass().getResourceAsStream("ipsum.html")) { + try (var is = getClass().getResourceAsStream("ipsum.html")) { return new String(is.readAllBytes(), StandardCharsets.UTF_8); } catch (Exception e) { return "Error reading the resource"; diff --git a/stuff/report-example/test-report.sh b/stuff/report-example/test-report.sh index 657b77f032cf1a424dab59db1eeaae3bafd55e33..fe8dd5ae34879e59c529c62827907058a934dcb3 100755 --- a/stuff/report-example/test-report.sh +++ b/stuff/report-example/test-report.sh @@ -3,6 +3,13 @@ # The script should be run on the same system. # Adjust the HOST parameter if necessary +die() { + echo $* + exit 1 +} + +[ -e powergoblin.sh ] || die powergoblin.sh missing + source powergoblin.sh export HOST=localhost:8080 diff --git a/update-deps.sh b/update-deps.sh new file mode 100644 index 0000000000000000000000000000000000000000..1a0b145806d5fb71cc3deea4ac337303b940b4cf --- /dev/null +++ b/update-deps.sh @@ -0,0 +1,14 @@ +# https://github.com/chartjs/Chart.js/releases +# https://github.com/sgratzl/chartjs-chart-boxplot + +chartjs=4.4.9 +chartjsboxplot=4.4.4 + +wget https://github.com/chartjs/Chart.js/releases/download/v$chartjs/chart.js-$chartjs.tgz +wget https://github.com/sgratzl/chartjs-chart-boxplot/releases/download/v$chartjsboxplot/package.tgz + +tar xvf chart.js-$chartjs.tgz package/dist/chart.umd.js.map package/dist/chart.umd.js --strip-components 2 +mv -v chart.umd.js chart.umd.js.map src/main/resources/fi/utu/tech/powergoblin/web/ + +tar xvf package.tgz package/build/index.umd.min.js package/build/index.umd.min.js.map --strip-components 2 +mv -v index.umd.min.js index.umd.min.js.map src/main/resources/fi/utu/tech/powergoblin/web/