Browse Source

[Hexagon] Refactor and update version (#7885)

* Fix error with URLs in JEE servers

* Clean up

* Avoid classpath URLs

* Fix template loading error

* Fix template loading error

* Chores

* Fix template loading error

* Delete MongoDB DB support

Storage support in Hexagon will be moved outside the Toolkit, and so, it will be left outside the benchmark.

* Fix runtime problem

* Update Hexagon version

* Make Jackson Blackbird module optional

* Add variation with Blackbird module enabled

* Upgrade Hexagon version

* Enable blackbird Jackson module by default

* Update dependencies

* Use Hexagon version 2.0.0-B1 (and a little cleanup)

* Use Hexagon version 2.0.0-B1 (and a little cleanup)

* Use Tomcat instead Resin to test JEE integration

* Remove unused environment variable

* Clean Tomcat dockerfile

* Minor improvements

* Minor improvements

* Update to release version

* Update to the latest Hexagon release

* Add Netty adapter test

* Remove Gradle Wrapper

* Update version

* Update version

* Minimize template

* Skip Hexagon checks in the container

* Add Netty Epoll benchmark

* Database and template improvements

* Update Hexagon version

* Update Hexagon version

* Update DB settings

* Use a single store and template engine to simplify benchmark

* Bump mysql-connector-java in /frameworks/Java/wicket

Bumps [mysql-connector-java](https://github.com/mysql/mysql-connector-j) from 8.0.27 to 8.0.28.
- [Release notes](https://github.com/mysql/mysql-connector-j/releases)
- [Changelog](https://github.com/mysql/mysql-connector-j/blob/release/8.0/CHANGES)
- [Commits](https://github.com/mysql/mysql-connector-j/compare/8.0.27...8.0.28)

---
updated-dependencies:
- dependency-name: mysql:mysql-connector-java
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump mongodb-driver-sync from 4.2.0 to 4.2.1 in /frameworks/Java/javalin

Bumps [mongodb-driver-sync](https://github.com/mongodb/mongo-java-driver) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/mongodb/mongo-java-driver/releases)
- [Commits](https://github.com/mongodb/mongo-java-driver/compare/r4.2.0...r4.2.1)

---
updated-dependencies:
- dependency-name: org.mongodb:mongodb-driver-sync
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ujson from 5.2.0 to 5.4.0 in /frameworks/Python/starlette

Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/ultrajson/ultrajson/releases)
- [Commits](https://github.com/ultrajson/ultrajson/compare/5.2.0...5.4.0)

---
updated-dependencies:
- dependency-name: ujson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ujson from 5.2.0 to 5.4.0 in /frameworks/Python/django

Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/ultrajson/ultrajson/releases)
- [Commits](https://github.com/ultrajson/ultrajson/compare/5.2.0...5.4.0)

---
updated-dependencies:
- dependency-name: ujson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ujson from 5.2.0 to 5.4.0 in /frameworks/Python/routerling

Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/ultrajson/ultrajson/releases)
- [Commits](https://github.com/ultrajson/ultrajson/compare/5.2.0...5.4.0)

---
updated-dependencies:
- dependency-name: ujson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ujson from 5.2.0 to 5.4.0 in /frameworks/Python/japronto

Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/ultrajson/ultrajson/releases)
- [Commits](https://github.com/ultrajson/ultrajson/compare/5.2.0...5.4.0)

---
updated-dependencies:
- dependency-name: ujson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ujson from 5.2.0 to 5.4.0 in /frameworks/Python/fastapi

Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/ultrajson/ultrajson/releases)
- [Commits](https://github.com/ultrajson/ultrajson/compare/5.2.0...5.4.0)

---
updated-dependencies:
- dependency-name: ujson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ujson from 5.2.0 to 5.4.0 in /frameworks/Python/uvicorn

Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/ultrajson/ultrajson/releases)
- [Commits](https://github.com/ultrajson/ultrajson/compare/5.2.0...5.4.0)

---
updated-dependencies:
- dependency-name: ujson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ujson from 5.2.0 to 5.4.0 in /frameworks/Python/flask

Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/ultrajson/ultrajson/releases)
- [Commits](https://github.com/ultrajson/ultrajson/compare/5.2.0...5.4.0)

---
updated-dependencies:
- dependency-name: ujson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ujson from 5.1 to 5.4.0 in /frameworks/Python/aiohttp

Bumps [ujson](https://github.com/ultrajson/ultrajson) from 5.1 to 5.4.0.
- [Release notes](https://github.com/ultrajson/ultrajson/releases)
- [Commits](https://github.com/ultrajson/ultrajson/compare/5.1.0...5.4.0)

---
updated-dependencies:
- dependency-name: ujson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump rails-html-sanitizer from 1.4.2 to 1.4.3 in /frameworks/Ruby/rails

Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/rails/rails-html-sanitizer/releases)
- [Changelog](https://github.com/rails/rails-html-sanitizer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.4.2...v1.4.3)

---
updated-dependencies:
- dependency-name: rails-html-sanitizer
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump jetty-server in /frameworks/Java/jetty

Bumps [jetty-server](https://github.com/eclipse/jetty.project) from 9.4.41.v20210516 to 10.0.10.
- [Release notes](https://github.com/eclipse/jetty.project/releases)
- [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.41.v20210516...jetty-10.0.10)

---
updated-dependencies:
- dependency-name: org.eclipse.jetty:jetty-server
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump undertow-core in /frameworks/Java/undertow

Bumps [undertow-core](https://github.com/undertow-io/undertow) from 2.2.11.Final to 2.2.15.Final.
- [Release notes](https://github.com/undertow-io/undertow/releases)
- [Commits](https://github.com/undertow-io/undertow/compare/2.2.11.Final...2.2.15.Final)

---
updated-dependencies:
- dependency-name: io.undertow:undertow-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update versions

* Update README.md

* Bump sanic from 22.3.1 to 22.6.1 in /frameworks/Python/sanic

Bumps [sanic](https://github.com/sanic-org/sanic) from 22.3.1 to 22.6.1.
- [Release notes](https://github.com/sanic-org/sanic/releases)
- [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/sanic-org/sanic/compare/v22.3.1...v22.6.1)

---
updated-dependencies:
- dependency-name: sanic
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/light-java

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/rapidoid

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/jooby

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/servlet

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/spring-webflux

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/smart-socket

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/act

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Kotlin/kooby

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/dropwizard

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.3.3 to 42.4.1 in /frameworks/Java/hserver

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.3...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.4.0 to 42.4.1 in /frameworks/Java/undertow

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.4.0 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.4.0...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump postgresql from 42.2.23 to 42.4.1 in /frameworks/Kotlin/ktor/ktor

Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.2.23 to 42.4.1.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.2.23...REL42.4.1)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update dependencies

* Bump undertow-core in /frameworks/Java/light-java

Bumps [undertow-core](https://github.com/undertow-io/undertow) from 2.2.15.Final to 2.2.19.Final.
- [Release notes](https://github.com/undertow-io/undertow/releases)
- [Commits](https://github.com/undertow-io/undertow/compare/2.2.15.Final...2.2.19.Final)

---
updated-dependencies:
- dependency-name: io.undertow:undertow-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump undertow-core in /frameworks/Java/undertow

Bumps [undertow-core](https://github.com/undertow-io/undertow) from 2.2.18.Final to 2.2.19.Final.
- [Release notes](https://github.com/undertow-io/undertow/releases)
- [Commits](https://github.com/undertow-io/undertow/compare/2.2.18.Final...2.2.19.Final)

---
updated-dependencies:
- dependency-name: io.undertow:undertow-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Delete Gradle Wrapper

* Use different JSON serializer

* Restore non Hexagon files

* Update Hexagon version

* Run pipeline

* Run pipeline

* Bump axum-core from 0.2.7 to 0.2.8 in /frameworks/Rust/axum

Bumps [axum-core](https://github.com/tokio-rs/axum) from 0.2.7 to 0.2.8.
- [Release notes](https://github.com/tokio-rs/axum/releases)
- [Changelog](https://github.com/tokio-rs/axum/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/axum/compare/axum-core-v0.2.7...axum-core-v0.2.8)

---
updated-dependencies:
- dependency-name: axum-core
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* Revert "Bump axum-core from 0.2.7 to 0.2.8 in /frameworks/Rust/axum"

This reverts commit 4422de8915e70cdca67a07c2e0fdb0610757924b.

* Version updates, code refactor and new benchmark cases

* Version updates

* Version updates

* Version updates

* [Hexagon] Refactor and updates:

* Update Hexagon version
* Use Rocker template
* Modularize the different scenarios

* Fix connection problems

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Juanjo Aguililla 2 years ago
parent
commit
b03f543f35
37 changed files with 367 additions and 181 deletions
  1. 10 45
      frameworks/Kotlin/hexagon/build.gradle
  2. 34 0
      frameworks/Kotlin/hexagon/core/build.gradle
  3. 27 0
      frameworks/Kotlin/hexagon/core/src/main/kotlin/Benchmark.kt
  4. 12 13
      frameworks/Kotlin/hexagon/core/src/main/kotlin/Controller.kt
  5. 4 3
      frameworks/Kotlin/hexagon/core/src/main/kotlin/Settings.kt
  6. 0 0
      frameworks/Kotlin/hexagon/core/src/main/kotlin/model/CachedWorld.kt
  7. 0 0
      frameworks/Kotlin/hexagon/core/src/main/kotlin/model/Fortune.kt
  8. 0 0
      frameworks/Kotlin/hexagon/core/src/main/kotlin/model/Message.kt
  9. 0 0
      frameworks/Kotlin/hexagon/core/src/main/kotlin/model/World.kt
  10. 0 0
      frameworks/Kotlin/hexagon/core/src/main/kotlin/store/BenchmarkStore.kt
  11. 0 0
      frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.pebble.html
  12. 24 0
      frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.rocker.html
  13. 5 8
      frameworks/Kotlin/hexagon/hexagon-jettyloom-pgclient.dockerfile
  14. 5 8
      frameworks/Kotlin/hexagon/hexagon-jettyloom.dockerfile
  15. 6 9
      frameworks/Kotlin/hexagon/hexagon-netty.dockerfile
  16. 6 9
      frameworks/Kotlin/hexagon/hexagon-nettyepoll-pgclient.dockerfile
  17. 6 9
      frameworks/Kotlin/hexagon/hexagon-nettyepoll.dockerfile
  18. 5 6
      frameworks/Kotlin/hexagon/hexagon-tomcat.dockerfile
  19. 6 9
      frameworks/Kotlin/hexagon/hexagon.dockerfile
  20. 13 0
      frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle
  21. 23 0
      frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/src/main/kotlin/Benchmark.kt
  22. 13 0
      frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle
  23. 23 0
      frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/src/main/kotlin/Benchmark.kt
  24. 13 0
      frameworks/Kotlin/hexagon/hexagon_netty_postgresql/build.gradle
  25. 17 0
      frameworks/Kotlin/hexagon/hexagon_netty_postgresql/src/main/kotlin/Benchmark.kt
  26. 14 0
      frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle
  27. 17 0
      frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/src/main/kotlin/Benchmark.kt
  28. 14 0
      frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle
  29. 17 0
      frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/src/main/kotlin/Benchmark.kt
  30. 15 0
      frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle
  31. 9 3
      frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/src/main/kotlin/WebListenerServer.kt
  32. 13 0
      frameworks/Kotlin/hexagon/settings.gradle
  33. 0 56
      frameworks/Kotlin/hexagon/src/main/kotlin/Benchmark.kt
  34. 6 0
      frameworks/Kotlin/hexagon/store_pgclient/build.gradle
  35. 3 2
      frameworks/Kotlin/hexagon/store_pgclient/src/main/kotlin/BenchmarkPgClientStore.kt
  36. 6 0
      frameworks/Kotlin/hexagon/store_sql/build.gradle
  37. 1 1
      frameworks/Kotlin/hexagon/store_sql/src/main/kotlin/BenchmarkSqlStore.kt

+ 10 - 45
frameworks/Kotlin/hexagon/build.gradle

@@ -1,61 +1,26 @@
 
 plugins {
-    id "org.jetbrains.kotlin.jvm" version "1.8.0"
+    id "org.jetbrains.kotlin.jvm" version "1.8.0" apply false
 }
 
+version = "1.0.0"
+description = "TFB benchmark"
+group = "com.hexagonkt"
+
 ext {
-    hexagonVersion = "2.4.1"
-    hexagonExtraVersion = "2.4.0"
+    hexagonVersion = "2.5.0"
     hikariVersion = "5.0.1"
     jettyVersion = "11.0.13"
     postgresqlVersion = "42.5.1"
     vertxVersion = "4.3.7"
     cache2kVersion = "2.6.1.Final"
-    nettyVersion = "4.1.86.Final"
+    nettyVersion = "4.1.87.Final"
 
     gradleScripts = "https://raw.githubusercontent.com/hexagonkt/hexagon/$hexagonVersion/gradle"
 }
 
-apply(from: "$gradleScripts/kotlin.gradle")
-apply(from: "$gradleScripts/application.gradle")
-
-apply(plugin: "war")
+defaultTasks("build")
 
-defaultTasks("installDist")
-
-application {
-    mainClass.set("com.hexagonkt.BenchmarkKt")
+subprojects {
+    apply(from: "$gradleScripts/kotlin.gradle")
 }
-
-war {
-    archiveFileName = "ROOT.war"
-}
-
-installDist.dependsOn("war")
-
-dependencies {
-    implementation("com.hexagonkt:http_server_netty_epoll:$hexagonVersion")
-    implementation("com.hexagonkt:http_server_jetty:$hexagonVersion")
-    implementation("com.hexagonkt:templates_pebble:$hexagonVersion")
-    implementation("com.hexagonkt:logging_slf4j_jul:$hexagonVersion")
-    implementation("com.hexagonkt:serialization_dsl_json:$hexagonVersion")
-
-    implementation("io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64")
-    implementation("org.cache2k:cache2k-core:$cache2kVersion")
-    implementation("com.zaxxer:HikariCP:$hikariVersion")
-    implementation("org.postgresql:postgresql:$postgresqlVersion")
-    implementation("io.vertx:vertx-pg-client:$vertxVersion")
-
-    // providedCompile excludes the dependency only in the WAR, not in the distribution
-    providedCompile("org.eclipse.jetty:jetty-webapp:$jettyVersion") { exclude module: "slf4j-api" }
-}
-
-tasks.register("minimizeTemplate") {
-    doLast {
-        File template = file("$buildDir/resources/main/fortunes.pebble.html")
-        List<String> lines = template.readLines().collect { it.trim() }
-        template.write(lines.join(""))
-    }
-}
-
-assemble.dependsOn("minimizeTemplate")

+ 34 - 0
frameworks/Kotlin/hexagon/core/build.gradle

@@ -0,0 +1,34 @@
+
+plugins {
+    id("nu.studer.rocker") version("3.0.4")
+}
+
+dependencies {
+    api("com.hexagonkt:http_server:$hexagonVersion")
+    api("com.hexagonkt:templates_pebble:$hexagonVersion")
+    api("com.hexagonkt:templates_rocker:$hexagonVersion")
+    api("com.hexagonkt:logging_slf4j_jul:$hexagonVersion")
+    api("com.hexagonkt:serialization_dsl_json:$hexagonVersion")
+    api("org.cache2k:cache2k-core:$cache2kVersion")
+}
+
+tasks.register("minimizeTemplate") {
+    doLast {
+        [ "fortunes.pebble.html", "fortunes.rocker.html" ].forEach { t ->
+            File template = file("$buildDir/resources/main/$t")
+            List<String> lines = template.readLines().collect { it.trim() }
+            template.write(lines.join(""))
+        }
+    }
+}
+
+jar.dependsOn("minimizeTemplate")
+
+rocker {
+    configurations {
+        create("main") {
+            templateDir.set(file("src/main/resources"))
+            optimize.set(true)
+        }
+    }
+}

+ 27 - 0
frameworks/Kotlin/hexagon/core/src/main/kotlin/Benchmark.kt

@@ -0,0 +1,27 @@
+package com.hexagonkt
+
+import com.hexagonkt.http.server.HttpServer
+import com.hexagonkt.http.server.HttpServerPort
+import com.hexagonkt.http.server.HttpServerSettings
+import com.hexagonkt.store.BenchmarkStore
+import com.hexagonkt.templates.TemplatePort
+import java.net.InetAddress
+import java.net.URL
+
+class Benchmark(
+    private val engine: HttpServerPort,
+    private val store: BenchmarkStore,
+    private val template: TemplatePort,
+    private val templateUrl: URL,
+    private val settings: Settings = Settings(),
+) {
+    val server: HttpServer by lazy {
+        val controller = Controller(settings, store, template, templateUrl)
+        val serverSettings = HttpServerSettings(
+            bindAddress = InetAddress.getByName(settings.bindAddress),
+            bindPort = settings.bindPort,
+        )
+
+        HttpServer(engine, controller.path, serverSettings)
+    }
+}

+ 12 - 13
frameworks/Kotlin/hexagon/src/main/kotlin/Controller.kt → frameworks/Kotlin/hexagon/core/src/main/kotlin/Controller.kt

@@ -7,10 +7,10 @@ import com.hexagonkt.core.media.TextMedia.PLAIN
 import com.hexagonkt.http.model.ContentType
 import com.hexagonkt.http.model.Header
 import com.hexagonkt.http.model.Headers
+import com.hexagonkt.http.server.callbacks.DateCallback
 import com.hexagonkt.http.server.handlers.HttpServerContext
 import com.hexagonkt.http.server.handlers.PathHandler
 import com.hexagonkt.http.server.handlers.path
-import com.hexagonkt.http.toHttpFormat
 import com.hexagonkt.model.*
 import com.hexagonkt.serialization.dsl.json.Json
 import com.hexagonkt.serialization.serialize
@@ -18,7 +18,6 @@ import com.hexagonkt.store.BenchmarkStore
 import com.hexagonkt.templates.TemplatePort
 
 import java.net.URL
-import java.time.LocalDateTime.now
 import java.util.concurrent.ThreadLocalRandom
 
 import kotlin.text.Charsets.UTF_8
@@ -27,29 +26,26 @@ class Controller(
     settings: Settings,
     store: BenchmarkStore,
     templateEngine: TemplatePort,
+    templateUrl: URL,
 ) {
     private val queriesParam: String = settings.queriesParam
     private val cachedQueriesParam: String = settings.cachedQueriesParam
     private val worldRows: Int = settings.worldRows
+    private val textMessage: String = settings.textMessage
 
     private val plain: ContentType = ContentType(PLAIN)
     private val json: ContentType = ContentType(JSON)
     private val html: ContentType = ContentType(HTML, charset = UTF_8)
 
-    private val templateUrl: URL = URL("classpath:fortunes.pebble.html")
+    private val headers = Headers(Header("server", "Hexagon"))
 
-    private val headers = Headers(
-        Header("server", "Hexagon"),
-    )
-
-    internal val path: PathHandler by lazy {
+    val path: PathHandler by lazy {
         path {
-            on("*") {
-                send(headers = headers + Header("date", now().toHttpFormat()))
-            }
+            on("*") { send(headers = headers) }
+            on("*", DateCallback())
 
-            get("/plaintext") { ok(settings.textMessage, contentType = plain) }
-            get("/json") { ok(Message(settings.textMessage).toMap().serialize(Json.raw), contentType = json) }
+            get("/plaintext") { ok(textMessage, contentType = plain) }
+            get("/json") { ok(Message(textMessage).toJson(), contentType = json) }
             get("/fortunes") { listFortunes(store, templateUrl, templateEngine) }
             get("/db") { dbQuery(store) }
             get("/query") { getWorlds(store) }
@@ -58,6 +54,9 @@ class Controller(
         }
     }
 
+    private fun Message.toJson(): String =
+        toMap().serialize(Json.raw)
+
     private fun HttpServerContext.listFortunes(
         store: BenchmarkStore, templateUrl: URL, templateAdapter: TemplatePort
     ): HttpServerContext {

+ 4 - 3
frameworks/Kotlin/hexagon/src/main/kotlin/Settings.kt → frameworks/Kotlin/hexagon/core/src/main/kotlin/Settings.kt

@@ -1,5 +1,6 @@
 package com.hexagonkt
 
+import com.hexagonkt.core.Jvm.systemFlag
 import com.hexagonkt.core.Jvm.systemSettingOrNull
 
 data class Settings(
@@ -23,9 +24,9 @@ data class Settings(
     val databaseName: String = systemSettingOrNull("database") ?: "hello_world",
     val databaseDriver: String = systemSettingOrNull("databaseDriver") ?: "org.postgresql.Driver",
 
-    val sendDateHeader: Boolean = systemSettingOrNull("sendDateHeader") ?: false,
-    val sendServerVersion: Boolean = systemSettingOrNull("sendServerVersion") ?: false,
-    val sendXPoweredBy: Boolean = systemSettingOrNull("sendXPoweredBy") ?: false,
+    val sendDateHeader: Boolean = systemFlag("sendDateHeader"),
+    val sendServerVersion: Boolean = systemFlag("sendServerVersion"),
+    val sendXPoweredBy: Boolean = systemFlag("sendXPoweredBy"),
 
     val worldRows: Int = 10_000,
     val textMessage: String = "Hello, World!",

+ 0 - 0
frameworks/Kotlin/hexagon/src/main/kotlin/model/CachedWorld.kt → frameworks/Kotlin/hexagon/core/src/main/kotlin/model/CachedWorld.kt


+ 0 - 0
frameworks/Kotlin/hexagon/src/main/kotlin/model/Fortune.kt → frameworks/Kotlin/hexagon/core/src/main/kotlin/model/Fortune.kt


+ 0 - 0
frameworks/Kotlin/hexagon/src/main/kotlin/model/Message.kt → frameworks/Kotlin/hexagon/core/src/main/kotlin/model/Message.kt


+ 0 - 0
frameworks/Kotlin/hexagon/src/main/kotlin/model/World.kt → frameworks/Kotlin/hexagon/core/src/main/kotlin/model/World.kt


+ 0 - 0
frameworks/Kotlin/hexagon/src/main/kotlin/store/BenchmarkStore.kt → frameworks/Kotlin/hexagon/core/src/main/kotlin/store/BenchmarkStore.kt


+ 0 - 0
frameworks/Kotlin/hexagon/src/main/resources/fortunes.pebble.html → frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.pebble.html


+ 24 - 0
frameworks/Kotlin/hexagon/core/src/main/resources/fortunes.rocker.html

@@ -0,0 +1,24 @@
+@import java.util.*
+@import com.hexagonkt.model.Fortune
+@args(Map<String, Object> context)
+<!DOCTYPE html>
+
+<html>
+<head>
+  <title>Fortunes</title>
+</head>
+<body>
+<table>
+  <tr>
+    <th>id</th>
+    <th>message</th>
+  </tr>
+  @for ((fortune) : (Collection<Fortune>)context.get("fortunes")) {
+  <tr>
+    <td>@fortune.getId()</td>
+    <td>@fortune.getMessage()</td>
+  </tr>
+  }
+</table>
+</body>
+</html>

+ 5 - 8
frameworks/Kotlin/hexagon/hexagon-jettyloom-pgclient.dockerfile

@@ -5,22 +5,19 @@ FROM gradle:7.6-jdk17-alpine AS build
 USER root
 WORKDIR /hexagon
 
-COPY src src
-COPY build.gradle build.gradle
+ADD . .
+RUN gradle --quiet compileRocker
 RUN gradle --quiet -x test
 
 #
 # RUNTIME
 #
 FROM eclipse-temurin:19-jre-alpine
-ENV DBSTORE pg_client
 ENV POSTGRESQL_DB_HOST tfb-database
-ENV WEBENGINE jetty_loom
-ENV PROJECT hexagon
-ENV DISABLE_CHECKS true
-ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV PROJECT hexagon_jetty_pgclient
+ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA -DvirtualThreads=true
 
-COPY --from=build /hexagon/build/install/$PROJECT /opt/$PROJECT
+COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 EXPOSE 9090
 

+ 5 - 8
frameworks/Kotlin/hexagon/hexagon-jettyloom.dockerfile

@@ -5,22 +5,19 @@ FROM gradle:7.6-jdk17-alpine AS build
 USER root
 WORKDIR /hexagon
 
-COPY src src
-COPY build.gradle build.gradle
+ADD . .
+RUN gradle --quiet compileRocker
 RUN gradle --quiet -x test
 
 #
 # RUNTIME
 #
 FROM eclipse-temurin:19-jre-alpine
-ENV DBSTORE postgresql
 ENV POSTGRESQL_DB_HOST tfb-database
-ENV WEBENGINE jetty_loom
-ENV PROJECT hexagon
-ENV DISABLE_CHECKS true
-ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV PROJECT hexagon_jetty_postgresql
+ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA -DvirtualThreads=true
 
-COPY --from=build /hexagon/build/install/$PROJECT /opt/$PROJECT
+COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 EXPOSE 9090
 

+ 6 - 9
frameworks/Kotlin/hexagon/hexagon-netty.dockerfile

@@ -5,22 +5,19 @@ FROM gradle:7.6-jdk17-alpine AS build
 USER root
 WORKDIR /hexagon
 
-COPY src src
-COPY build.gradle build.gradle
+ADD . .
+RUN gradle --quiet compileRocker
 RUN gradle --quiet -x test
 
 #
 # RUNTIME
 #
-FROM eclipse-temurin:19-jre-alpine
-ENV DBSTORE postgresql
+FROM eclipse-temurin:17-jre-alpine
 ENV POSTGRESQL_DB_HOST tfb-database
-ENV WEBENGINE netty
-ENV PROJECT hexagon
-ENV DISABLE_CHECKS true
-ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV PROJECT hexagon_netty_postgresql
+ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 
-COPY --from=build /hexagon/build/install/$PROJECT /opt/$PROJECT
+COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 EXPOSE 9090
 

+ 6 - 9
frameworks/Kotlin/hexagon/hexagon-nettyepoll-pgclient.dockerfile

@@ -5,22 +5,19 @@ FROM gradle:7.6-jdk17-alpine AS build
 USER root
 WORKDIR /hexagon
 
-COPY src src
-COPY build.gradle build.gradle
+ADD . .
+RUN gradle --quiet compileRocker
 RUN gradle --quiet -x test
 
 #
 # RUNTIME
 #
-FROM eclipse-temurin:19-jre-alpine
-ENV DBSTORE pg_client
+FROM eclipse-temurin:17-jre-alpine
 ENV POSTGRESQL_DB_HOST tfb-database
-ENV WEBENGINE netty_epoll
-ENV PROJECT hexagon
-ENV DISABLE_CHECKS true
-ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV PROJECT hexagon_nettyepoll_pgclient
+ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 
-COPY --from=build /hexagon/build/install/$PROJECT /opt/$PROJECT
+COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 EXPOSE 9090
 

+ 6 - 9
frameworks/Kotlin/hexagon/hexagon-nettyepoll.dockerfile

@@ -5,22 +5,19 @@ FROM gradle:7.6-jdk17-alpine AS build
 USER root
 WORKDIR /hexagon
 
-COPY src src
-COPY build.gradle build.gradle
+ADD . .
+RUN gradle --quiet compileRocker
 RUN gradle --quiet -x test
 
 #
 # RUNTIME
 #
-FROM eclipse-temurin:19-jre-alpine
-ENV DBSTORE postgresql
+FROM eclipse-temurin:17-jre-alpine
 ENV POSTGRESQL_DB_HOST tfb-database
-ENV WEBENGINE netty_epoll
-ENV PROJECT hexagon
-ENV DISABLE_CHECKS true
-ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV PROJECT hexagon_nettyepoll_postgresql
+ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 
-COPY --from=build /hexagon/build/install/$PROJECT /opt/$PROJECT
+COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 EXPOSE 9090
 

+ 5 - 6
frameworks/Kotlin/hexagon/hexagon-tomcat.dockerfile

@@ -5,18 +5,17 @@ FROM gradle:7.6-jdk17-alpine AS build
 USER root
 WORKDIR /hexagon
 
-COPY src src
-COPY build.gradle build.gradle
+ADD . .
+RUN gradle --quiet compileRocker
 RUN gradle --quiet -x test
 
 #
 # RUNTIME
 #
 FROM tomcat:10.1.2-jre17-temurin
-ENV DBSTORE postgresql
 ENV POSTGRESQL_DB_HOST tfb-database
-ENV DISABLE_CHECKS true
-ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV MODULE /hexagon/hexagon_tomcat_postgresql
+ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 
-COPY --from=build /hexagon/build/libs/ROOT.war /usr/local/tomcat/webapps/ROOT.war
+COPY --from=build $MODULE/build/libs/ROOT.war /usr/local/tomcat/webapps/ROOT.war
 EXPOSE 8080

+ 6 - 9
frameworks/Kotlin/hexagon/hexagon.dockerfile

@@ -5,22 +5,19 @@ FROM gradle:7.6-jdk17-alpine AS build
 USER root
 WORKDIR /hexagon
 
-COPY src src
-COPY build.gradle build.gradle
+ADD . .
+RUN gradle --quiet compileRocker
 RUN gradle --quiet -x test
 
 #
 # RUNTIME
 #
-FROM eclipse-temurin:19-jre-alpine
-ENV DBSTORE postgresql
+FROM eclipse-temurin:17-jre-alpine
 ENV POSTGRESQL_DB_HOST tfb-database
-ENV WEBENGINE jetty
-ENV PROJECT hexagon
-ENV DISABLE_CHECKS true
-ENV JDK_JAVA_OPTIONS --enable-preview -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
+ENV PROJECT hexagon_jetty_postgresql
+ENV JDK_JAVA_OPTIONS -XX:+AlwaysPreTouch -XX:+UseParallelGC -XX:+UseNUMA
 
-COPY --from=build /hexagon/build/install/$PROJECT /opt/$PROJECT
+COPY --from=build /hexagon/$PROJECT/build/install/$PROJECT /opt/$PROJECT
 
 EXPOSE 9090
 

+ 13 - 0
frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/build.gradle

@@ -0,0 +1,13 @@
+
+apply(from: "$gradleScripts/application.gradle")
+
+application {
+    mainClass.set("com.hexagonkt.BenchmarkKt")
+}
+
+dependencies {
+    api(project(":store_pgclient"))
+    api("com.hexagonkt:http_server_jetty:$hexagonVersion")
+}
+
+build.dependsOn("installDist")

+ 23 - 0
frameworks/Kotlin/hexagon/hexagon_jetty_pgclient/src/main/kotlin/Benchmark.kt

@@ -0,0 +1,23 @@
+package com.hexagonkt
+
+import com.hexagonkt.core.Jvm.systemFlag
+import com.hexagonkt.http.server.jetty.JettyServletAdapter
+import com.hexagonkt.store.BenchmarkPgClientStore
+import com.hexagonkt.templates.rocker.RockerAdapter
+import java.net.URL
+
+fun main() {
+    val settings = Settings()
+    val store = BenchmarkPgClientStore("postgresql")
+    val templateEngine = RockerAdapter()
+    val templateUrl = URL("classpath:fortunes.rocker.html")
+    val engine = JettyServletAdapter(
+        sendDateHeader = settings.sendDateHeader,
+        sendServerVersion = settings.sendServerVersion,
+        sendXPoweredBy = settings.sendXPoweredBy,
+        useVirtualThreads = systemFlag("virtualThreads"),
+    )
+
+    val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings)
+    benchmark.server.start()
+}

+ 13 - 0
frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/build.gradle

@@ -0,0 +1,13 @@
+
+apply(from: "$gradleScripts/application.gradle")
+
+application {
+    mainClass.set("com.hexagonkt.BenchmarkKt")
+}
+
+dependencies {
+    api(project(":store_sql"))
+    api("com.hexagonkt:http_server_jetty:$hexagonVersion")
+}
+
+build.dependsOn("installDist")

+ 23 - 0
frameworks/Kotlin/hexagon/hexagon_jetty_postgresql/src/main/kotlin/Benchmark.kt

@@ -0,0 +1,23 @@
+package com.hexagonkt
+
+import com.hexagonkt.core.Jvm.systemFlag
+import com.hexagonkt.http.server.jetty.JettyServletAdapter
+import com.hexagonkt.store.BenchmarkSqlStore
+import com.hexagonkt.templates.rocker.RockerAdapter
+import java.net.URL
+
+fun main() {
+    val settings = Settings()
+    val store = BenchmarkSqlStore("postgresql")
+    val templateEngine = RockerAdapter()
+    val templateUrl = URL("classpath:fortunes.rocker.html")
+    val engine = JettyServletAdapter(
+        sendDateHeader = settings.sendDateHeader,
+        sendServerVersion = settings.sendServerVersion,
+        sendXPoweredBy = settings.sendXPoweredBy,
+        useVirtualThreads = systemFlag("virtualThreads"),
+    )
+
+    val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings)
+    benchmark.server.start()
+}

+ 13 - 0
frameworks/Kotlin/hexagon/hexagon_netty_postgresql/build.gradle

@@ -0,0 +1,13 @@
+
+apply(from: "$gradleScripts/application.gradle")
+
+application {
+    mainClass.set("com.hexagonkt.BenchmarkKt")
+}
+
+dependencies {
+    api(project(":store_sql"))
+    api("com.hexagonkt:http_server_netty:$hexagonVersion")
+}
+
+build.dependsOn("installDist")

+ 17 - 0
frameworks/Kotlin/hexagon/hexagon_netty_postgresql/src/main/kotlin/Benchmark.kt

@@ -0,0 +1,17 @@
+package com.hexagonkt
+
+import com.hexagonkt.http.server.netty.NettyServerAdapter
+import com.hexagonkt.store.BenchmarkSqlStore
+import com.hexagonkt.templates.rocker.RockerAdapter
+import java.net.URL
+
+fun main() {
+    val settings = Settings()
+    val store = BenchmarkSqlStore("postgresql")
+    val templateEngine = RockerAdapter()
+    val templateUrl = URL("classpath:fortunes.rocker.html")
+    val engine = NettyServerAdapter()
+
+    val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings)
+    benchmark.server.start()
+}

+ 14 - 0
frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/build.gradle

@@ -0,0 +1,14 @@
+
+apply(from: "$gradleScripts/application.gradle")
+
+application {
+    mainClass.set("com.hexagonkt.BenchmarkKt")
+}
+
+dependencies {
+    api(project(":store_pgclient"))
+    api("com.hexagonkt:http_server_netty_epoll:$hexagonVersion")
+    api("io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64")
+}
+
+build.dependsOn("installDist")

+ 17 - 0
frameworks/Kotlin/hexagon/hexagon_nettyepoll_pgclient/src/main/kotlin/Benchmark.kt

@@ -0,0 +1,17 @@
+package com.hexagonkt
+
+import com.hexagonkt.http.server.netty.epoll.NettyEpollServerAdapter
+import com.hexagonkt.store.BenchmarkPgClientStore
+import com.hexagonkt.templates.rocker.RockerAdapter
+import java.net.URL
+
+fun main() {
+    val settings = Settings()
+    val store = BenchmarkPgClientStore("postgresql")
+    val templateEngine = RockerAdapter()
+    val templateUrl = URL("classpath:fortunes.rocker.html")
+    val engine = NettyEpollServerAdapter()
+
+    val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings)
+    benchmark.server.start()
+}

+ 14 - 0
frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/build.gradle

@@ -0,0 +1,14 @@
+
+apply(from: "$gradleScripts/application.gradle")
+
+application {
+    mainClass.set("com.hexagonkt.BenchmarkKt")
+}
+
+dependencies {
+    api(project(":store_sql"))
+    api("com.hexagonkt:http_server_netty_epoll:$hexagonVersion")
+    api("io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64")
+}
+
+build.dependsOn("installDist")

+ 17 - 0
frameworks/Kotlin/hexagon/hexagon_nettyepoll_postgresql/src/main/kotlin/Benchmark.kt

@@ -0,0 +1,17 @@
+package com.hexagonkt
+
+import com.hexagonkt.http.server.netty.epoll.NettyEpollServerAdapter
+import com.hexagonkt.store.BenchmarkSqlStore
+import com.hexagonkt.templates.rocker.RockerAdapter
+import java.net.URL
+
+fun main() {
+    val settings = Settings()
+    val store = BenchmarkSqlStore("postgresql")
+    val templateEngine = RockerAdapter()
+    val templateUrl = URL("classpath:fortunes.rocker.html")
+    val engine = NettyEpollServerAdapter()
+
+    val benchmark = Benchmark(engine, store, templateEngine, templateUrl, settings)
+    benchmark.server.start()
+}

+ 15 - 0
frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/build.gradle

@@ -0,0 +1,15 @@
+
+apply(plugin: "war")
+
+war {
+    archiveFileName = "ROOT.war"
+}
+
+build.dependsOn("war")
+
+dependencies {
+    api(project(":store_sql"))
+    api("com.hexagonkt:http_server_servlet:$hexagonVersion")
+
+    compileOnly("jakarta.servlet:jakarta.servlet-api:5.0.0")
+}

+ 9 - 3
frameworks/Kotlin/hexagon/src/main/kotlin/WebListenerServer.kt → frameworks/Kotlin/hexagon/hexagon_tomcat_postgresql/src/main/kotlin/WebListenerServer.kt

@@ -6,16 +6,22 @@ import com.hexagonkt.http.server.handlers.HttpHandler
 import com.hexagonkt.http.server.handlers.OnHandler
 import com.hexagonkt.http.server.servlet.ServletServer
 import com.hexagonkt.store.BenchmarkSqlStore
-import com.hexagonkt.templates.pebble.PebbleAdapter
+import com.hexagonkt.templates.rocker.RockerAdapter
 import jakarta.servlet.annotation.WebListener
+import java.net.URL
 
-@WebListener class WebListenerServer(settings: Settings = Settings()) : ServletServer(createHandlers(settings)) {
+@WebListener class WebListenerServer(
+    settings: Settings = Settings()
+) : ServletServer(createHandlers(settings)) {
 
     private companion object {
         val headers = Headers(Header("server", "Tomcat"))
 
         fun createHandlers(settings: Settings): List<HttpHandler> {
-            val controller = Controller(settings, BenchmarkSqlStore("postgresql"), PebbleAdapter())
+            val store = BenchmarkSqlStore("postgresql")
+            val templateEngine = RockerAdapter()
+            val templateUrl = URL("classpath:fortunes.rocker.html")
+            val controller = Controller(settings, store, templateEngine, templateUrl)
             val controllerPath = controller.path
             val serverHeaderHandler = OnHandler("*") {
                 send(headers = headers)

+ 13 - 0
frameworks/Kotlin/hexagon/settings.gradle

@@ -0,0 +1,13 @@
+
+include(
+    "core",
+    "store_pgclient",
+    "store_sql",
+
+    "hexagon_jetty_pgclient",
+    "hexagon_jetty_postgresql",
+    "hexagon_netty_postgresql",
+    "hexagon_nettyepoll_pgclient",
+    "hexagon_nettyepoll_postgresql",
+    "hexagon_tomcat_postgresql",
+)

+ 0 - 56
frameworks/Kotlin/hexagon/src/main/kotlin/Benchmark.kt

@@ -1,56 +0,0 @@
-package com.hexagonkt
-
-import com.hexagonkt.http.server.HttpServer
-import com.hexagonkt.http.server.HttpServerPort
-import com.hexagonkt.http.server.HttpServerSettings
-import com.hexagonkt.http.server.jetty.JettyServletAdapter
-import com.hexagonkt.http.server.netty.NettyServerAdapter
-import com.hexagonkt.http.server.netty.epoll.NettyEpollServerAdapter
-import com.hexagonkt.store.BenchmarkPgClientStore
-import com.hexagonkt.store.BenchmarkSqlStore
-import com.hexagonkt.store.BenchmarkStore
-import com.hexagonkt.templates.pebble.PebbleAdapter
-import java.net.InetAddress
-
-internal val settings = Settings()
-
-private val engines: Map<String, HttpServerPort> by lazy {
-    mapOf(
-        "jetty" to JettyServletAdapter(
-            sendDateHeader = settings.sendDateHeader,
-            sendServerVersion = settings.sendServerVersion,
-            sendXPoweredBy = settings.sendXPoweredBy,
-        ),
-        "jetty_loom" to JettyServletAdapter(
-            sendDateHeader = settings.sendDateHeader,
-            sendServerVersion = settings.sendServerVersion,
-            sendXPoweredBy = settings.sendXPoweredBy,
-            useVirtualThreads = true,
-        ),
-        "netty" to NettyServerAdapter(),
-        "netty_epoll" to NettyEpollServerAdapter(),
-    )
-}
-
-private val stores: Map<String, BenchmarkStore> by lazy {
-    mapOf(
-        "postgresql" to BenchmarkSqlStore("postgresql"),
-        "pg_client" to BenchmarkPgClientStore("postgresql"),
-    )
-}
-
-internal val server: HttpServer by lazy {
-    val engine = engines[settings.webEngine] ?: error("Unsupported server engine")
-    val store = stores[settings.dataStore] ?: error("Unsupported data store")
-    val controller = Controller(settings, store, PebbleAdapter())
-    val serverSettings = HttpServerSettings(
-        bindAddress = InetAddress.getByName(settings.bindAddress),
-        bindPort = settings.bindPort,
-    )
-
-    HttpServer(engine, controller.path, serverSettings)
-}
-
-fun main() {
-    server.start()
-}

+ 6 - 0
frameworks/Kotlin/hexagon/store_pgclient/build.gradle

@@ -0,0 +1,6 @@
+
+dependencies {
+    api(project(":core"))
+    implementation("io.vertx:vertx-pg-client:$vertxVersion")
+    implementation("com.ongres.scram:client:2.1")
+}

+ 3 - 2
frameworks/Kotlin/hexagon/src/main/kotlin/store/BenchmarkPgClientStore.kt → frameworks/Kotlin/hexagon/store_pgclient/src/main/kotlin/BenchmarkPgClientStore.kt

@@ -11,8 +11,9 @@ import io.vertx.pgclient.PgPool
 import io.vertx.sqlclient.*
 import org.cache2k.Cache
 
-internal class BenchmarkPgClientStore(
-    engine: String, private val settings: Settings = Settings()
+class BenchmarkPgClientStore(
+    engine: String,
+    private val settings: Settings = Settings(),
 ) : BenchmarkStore(settings) {
 
     companion object {

+ 6 - 0
frameworks/Kotlin/hexagon/store_sql/build.gradle

@@ -0,0 +1,6 @@
+
+dependencies {
+    api(project(":core"))
+    implementation("com.zaxxer:HikariCP:$hikariVersion")
+    implementation("org.postgresql:postgresql:$postgresqlVersion")
+}

+ 1 - 1
frameworks/Kotlin/hexagon/src/main/kotlin/store/BenchmarkSqlStore.kt → frameworks/Kotlin/hexagon/store_sql/src/main/kotlin/BenchmarkSqlStore.kt

@@ -11,7 +11,7 @@ import org.cache2k.Cache
 import java.sql.Connection
 import java.sql.PreparedStatement
 
-internal class BenchmarkSqlStore(
+class BenchmarkSqlStore(
     engine: String, private val settings: Settings = Settings()
 ) : BenchmarkStore(settings) {