Просмотр исходного кода

Hexagon: use a single store and template engine to simplify benchmark (#7401)

* 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

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 3 лет назад
Родитель
Сommit
6be7f9514f

+ 17 - 21
frameworks/Kotlin/hexagon/README.md

@@ -2,7 +2,7 @@
 # Hexagon Benchmarking Test
 
 This is the Hexagon portion of a [benchmarking test suite](../../../README.md) comparing a variety
-of web development platforms. The test utilizes Hexagon routes, serialization and database access.
+of web development platforms. The test utilizes Hexagon routes and serialization.
 
 ## Tests
 
@@ -18,42 +18,38 @@ To run the full benchmarks locally, on the project root (not this directory) exe
 
 ## Test URLs
 
-In URLs replace `${DB_ENGINE}` with: `postgresql`
-
-and `${TEMPLATE_ENGINE}` with: `pebble`
-
 ### Jetty
 
 * JSON Encoding Test: http://localhost:9090/json
 * Plain Text Test: http://localhost:9090/plaintext
-* Data-Store/Database Mapping Test: http://localhost:9090/${DB_ENGINE}/db?queries=5
-* Fortunes: http://localhost:9090/${DB_ENGINE}/${TEMPLATE_ENGINE}/fortunes
-* Database updates: http://localhost:9090/${DB_ENGINE}/update
-* Database queries: http://localhost:9090/${DB_ENGINE}/query
+* Data-Store/Database Mapping Test: http://localhost:9090/db?queries=5
+* Fortunes: http://localhost:9090/fortunes
+* Database updates: http://localhost:9090/update
+* Database queries: http://localhost:9090/query
 
 ### Netty
 
 * JSON Encoding Test: http://localhost:9090/json
 * Plain Text Test: http://localhost:9090/plaintext
-* Data-Store/Database Mapping Test: http://localhost:9090/${DB_ENGINE}/db?queries=5
-* Fortunes: http://localhost:9090/${DB_ENGINE}/${TEMPLATE_ENGINE}/fortunes
-* Database updates: http://localhost:9090/${DB_ENGINE}/update
-* Database queries: http://localhost:9090/${DB_ENGINE}/query
+* Data-Store/Database Mapping Test: http://localhost:9090/db?queries=5
+* Fortunes: http://localhost:9090/fortunes
+* Database updates: http://localhost:9090/update
+* Database queries: http://localhost:9090/query
 
 ### Netty Epoll
 
 * JSON Encoding Test: http://localhost:9090/json
 * Plain Text Test: http://localhost:9090/plaintext
-* Data-Store/Database Mapping Test: http://localhost:9090/${DB_ENGINE}/db?queries=5
-* Fortunes: http://localhost:9090/${DB_ENGINE}/${TEMPLATE_ENGINE}/fortunes
-* Database updates: http://localhost:9090/${DB_ENGINE}/update
-* Database queries: http://localhost:9090/${DB_ENGINE}/query
+* Data-Store/Database Mapping Test: http://localhost:9090/db?queries=5
+* Fortunes: http://localhost:9090/fortunes
+* Database updates: http://localhost:9090/update
+* Database queries: http://localhost:9090/query
 
 ### Tomcat
 
 * JSON Encoding Test: http://localhost:8080/json
 * Plain Text Test: http://localhost:8080/plaintext
-* Data-Store/Database Mapping Test: http://localhost:8080/${DB_ENGINE}/db?queries=5
-* Fortunes: http://localhost:8080/${DB_ENGINE}/${TEMPLATE_ENGINE}/fortunes
-* Database updates: http://localhost:8080/${DB_ENGINE}/update
-* Database queries: http://localhost:8080/${DB_ENGINE}/query
+* Data-Store/Database Mapping Test: http://localhost:8080/db?queries=5
+* Fortunes: http://localhost:8080/fortunes
+* Database updates: http://localhost:8080/update
+* Database queries: http://localhost:8080/query

+ 20 - 20
frameworks/Kotlin/hexagon/benchmark_config.json

@@ -4,11 +4,11 @@
         {
             "default": {
                 "json_url": "/json",
-                "db_url": "/postgresql/db",
-                "query_url": "/postgresql/query?queries=",
-                "fortune_url": "/postgresql/pebble/fortunes",
-                "update_url": "/postgresql/update?queries=",
-                "cached_query_url": "/postgresql/cached?count=",
+                "db_url": "/db",
+                "query_url": "/query?queries=",
+                "fortune_url": "/fortunes",
+                "update_url": "/update?queries=",
+                "cached_query_url": "/cached-queries?count=",
                 "plaintext_url": "/plaintext",
                 "port": 9090,
                 "approach": "Realistic",
@@ -27,11 +27,11 @@
             },
             "netty": {
                 "json_url": "/json",
-                "db_url": "/postgresql/db",
-                "query_url": "/postgresql/query?queries=",
-                "fortune_url": "/postgresql/pebble/fortunes",
-                "update_url": "/postgresql/update?queries=",
-                "cached_query_url": "/postgresql/cached?count=",
+                "db_url": "/db",
+                "query_url": "/query?queries=",
+                "fortune_url": "/fortunes",
+                "update_url": "/update?queries=",
+                "cached_query_url": "/cached-queries?count=",
                 "plaintext_url": "/plaintext",
                 "port": 9090,
                 "approach": "Realistic",
@@ -50,11 +50,11 @@
             },
             "nettyepoll": {
                 "json_url": "/json",
-                "db_url": "/postgresql/db",
-                "query_url": "/postgresql/query?queries=",
-                "fortune_url": "/postgresql/pebble/fortunes",
-                "update_url": "/postgresql/update?queries=",
-                "cached_query_url": "/postgresql/cached?count=",
+                "db_url": "/db",
+                "query_url": "/query?queries=",
+                "fortune_url": "/fortunes",
+                "update_url": "/update?queries=",
+                "cached_query_url": "/cached-queries?count=",
                 "plaintext_url": "/plaintext",
                 "port": 9090,
                 "approach": "Realistic",
@@ -73,11 +73,11 @@
             },
             "tomcat": {
                 "json_url": "/json",
-                "db_url": "/postgresql/db",
-                "query_url": "/postgresql/query?queries=",
-                "fortune_url": "/postgresql/pebble/fortunes",
-                "update_url": "/postgresql/update?queries=",
-                "cached_query_url": "/postgresql/cached?count=",
+                "db_url": "/db",
+                "query_url": "/query?queries=",
+                "fortune_url": "/fortunes",
+                "update_url": "/update?queries=",
+                "cached_query_url": "/cached-queries?count=",
                 "plaintext_url": "/plaintext",
                 "port": 8080,
                 "approach": "Realistic",

+ 5 - 6
frameworks/Kotlin/hexagon/build.gradle

@@ -1,15 +1,15 @@
 
 plugins {
-    id "org.jetbrains.kotlin.jvm" version "1.6.21"
+    id "org.jetbrains.kotlin.jvm" version "1.7.10"
 }
 
 ext {
-    hexagonVersion = "2.0.8"
+    hexagonVersion = "2.0.17"
     hikariVersion = "5.0.1"
-    jettyVersion = "11.0.9"
-    postgresqlVersion = "42.3.4"
+    jettyVersion = "11.0.11"
+    postgresqlVersion = "42.4.0"
     cache2kVersion = "2.6.1.Final"
-    nettyVersion = "4.1.76.Final"
+    nettyVersion = "4.1.79.Final"
 
     gradleScripts = "https://raw.githubusercontent.com/hexagonkt/hexagon/$hexagonVersion/gradle"
 }
@@ -32,7 +32,6 @@ war {
 installDist.dependsOn("war")
 
 dependencies {
-    implementation("com.hexagonkt:http_server_netty:$hexagonVersion")
     implementation("com.hexagonkt:http_server_netty_epoll:$hexagonVersion")
     implementation("com.hexagonkt:http_server_jetty:$hexagonVersion")
     implementation("com.hexagonkt:templates_pebble:$hexagonVersion")

+ 20 - 20
frameworks/Kotlin/hexagon/config.toml

@@ -4,11 +4,11 @@ name = "hexagon"
 [main]
 urls.plaintext = "/plaintext"
 urls.json = "/json"
-urls.db = "/postgresql/db"
-urls.query = "/postgresql/query?queries="
-urls.update = "/postgresql/update?queries="
-urls.fortune = "/postgresql/pebble/fortunes"
-urls.cached_query = "/postgresql/cached?count="
+urls.db = "/db"
+urls.query = "/query?queries="
+urls.update = "/update?queries="
+urls.fortune = "/fortunes"
+urls.cached_query = "/cached-queries?count="
 approach = "Realistic"
 classification = "Micro"
 database = "postgres"
@@ -22,11 +22,11 @@ versus = "servlet"
 [netty]
 urls.plaintext = "/plaintext"
 urls.json = "/json"
-urls.db = "/postgresql/db"
-urls.query = "/postgresql/query?queries="
-urls.update = "/postgresql/update?queries="
-urls.fortune = "/postgresql/pebble/fortunes"
-urls.cached_query = "/postgresql/cached?count="
+urls.db = "/db"
+urls.query = "/query?queries="
+urls.update = "/update?queries="
+urls.fortune = "/fortunes"
+urls.cached_query = "/cached-queries?count="
 approach = "Realistic"
 classification = "Micro"
 database = "postgres"
@@ -40,11 +40,11 @@ versus = "netty"
 [nettyepoll]
 urls.plaintext = "/plaintext"
 urls.json = "/json"
-urls.db = "/postgresql/db"
-urls.query = "/postgresql/query?queries="
-urls.update = "/postgresql/update?queries="
-urls.fortune = "/postgresql/pebble/fortunes"
-urls.cached_query = "/postgresql/cached?count="
+urls.db = "/db"
+urls.query = "/query?queries="
+urls.update = "/update?queries="
+urls.fortune = "/fortunes"
+urls.cached_query = "/cached-queries?count="
 approach = "Realistic"
 classification = "Micro"
 database = "postgres"
@@ -58,11 +58,11 @@ versus = "netty"
 [tomcat]
 urls.plaintext = "/plaintext"
 urls.json = "/json"
-urls.db = "/postgresql/db"
-urls.query = "/postgresql/query?queries="
-urls.update = "/postgresql/update?queries="
-urls.fortune = "/postgresql/pebble/fortunes"
-urls.cached_query = "/postgresql/cached?count="
+urls.db = "/db"
+urls.query = "/query?queries="
+urls.update = "/update?queries="
+urls.fortune = "/fortunes"
+urls.cached_query = "/cached-queries?count="
 approach = "Realistic"
 classification = "Micro"
 database = "postgres"

+ 1 - 1
frameworks/Kotlin/hexagon/hexagon-netty.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM gradle:7.4.2-jdk11 AS gradle_build
+FROM gradle:7.5.0-jdk17-alpine AS gradle_build
 USER root
 WORKDIR /hexagon
 

+ 1 - 1
frameworks/Kotlin/hexagon/hexagon-nettyepoll.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM gradle:7.4.2-jdk11 AS gradle_build
+FROM gradle:7.5.0-jdk17-alpine AS gradle_build
 USER root
 WORKDIR /hexagon
 

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-tomcat.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM gradle:7.4.2-jdk11 AS gradle_build
+FROM gradle:7.5.0-jdk17-alpine AS gradle_build
 USER root
 WORKDIR /hexagon
 
@@ -12,7 +12,7 @@ RUN gradle --quiet
 #
 # RUNTIME
 #
-FROM tomcat:10.0.14-jre17-temurin
+FROM tomcat:10.1.0-jre17-temurin
 ENV DBSTORE postgresql
 ENV POSTGRESQL_DB_HOST tfb-database
 ENV DISABLE_CHECKS true

+ 1 - 1
frameworks/Kotlin/hexagon/hexagon.dockerfile

@@ -1,7 +1,7 @@
 #
 # BUILD
 #
-FROM gradle:7.4.2-jdk11 AS gradle_build
+FROM gradle:7.5.0-jdk17-alpine AS gradle_build
 USER root
 WORKDIR /hexagon
 

+ 1 - 11
frameworks/Kotlin/hexagon/src/main/kotlin/Benchmark.kt

@@ -7,21 +7,11 @@ 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.BenchmarkSqlStore
-import com.hexagonkt.store.BenchmarkStore
-import com.hexagonkt.templates.TemplatePort
 import com.hexagonkt.templates.pebble.PebbleAdapter
 import java.net.InetAddress
 
 internal val settings = Settings()
 
-internal val stores: Map<String, BenchmarkStore> by lazy {
-    mapOf("postgresql" to BenchmarkSqlStore("postgresql"))
-}
-
-internal val templateEngines: Map<String, TemplatePort> by lazy {
-    mapOf("pebble" to PebbleAdapter)
-}
-
 private val engines: Map<String, HttpServerPort> by lazy {
     mapOf(
         "jetty" to JettyServletAdapter(
@@ -36,7 +26,7 @@ private val engines: Map<String, HttpServerPort> by lazy {
 
 private val server: HttpServer by lazy {
     val engine = engines[settings.webEngine] ?: error("Unsupported server engine")
-    val controller = Controller(settings, stores, templateEngines)
+    val controller = Controller(settings, BenchmarkSqlStore("postgresql"), PebbleAdapter)
     val serverSettings = HttpServerSettings(
         bindAddress = InetAddress.getByName(settings.bindAddress),
         bindPort = settings.bindPort,

+ 14 - 26
frameworks/Kotlin/hexagon/src/main/kotlin/Controller.kt

@@ -1,11 +1,11 @@
 package com.hexagonkt
 
-import com.hexagonkt.core.require
 import com.hexagonkt.core.media.ApplicationMedia.JSON
 import com.hexagonkt.core.media.TextMedia.HTML
 import com.hexagonkt.core.media.TextMedia.PLAIN
-import com.hexagonkt.core.multiMapOf
 import com.hexagonkt.http.model.ContentType
+import com.hexagonkt.http.model.Header
+import com.hexagonkt.http.model.HttpFields
 import com.hexagonkt.http.server.handlers.HttpServerContext
 import com.hexagonkt.http.server.handlers.PathHandler
 import com.hexagonkt.http.server.handlers.path
@@ -23,8 +23,8 @@ import kotlin.text.Charsets.UTF_8
 
 class Controller(
     settings: Settings,
-    stores: Map<String, BenchmarkStore>,
-    templateEngines: Map<String, TemplatePort>,
+    store: BenchmarkStore,
+    templateEngine: TemplatePort,
 ) {
     private val queriesParam: String = settings.queriesParam
     private val cachedQueriesParam: String = settings.cachedQueriesParam
@@ -34,37 +34,25 @@ class Controller(
     private val json: ContentType = ContentType(JSON)
     private val html: ContentType = ContentType(HTML, charset = UTF_8)
 
-    private val templates: Map<String, URL> = mapOf(
-        "pebble" to URL("classpath:fortunes.pebble.html")
+    private val templateUrl: URL = URL("classpath:fortunes.pebble.html")
+
+    private val headers = HttpFields(
+        Header("server", "Hexagon"),
     )
 
     internal val path: PathHandler by lazy {
         path {
             on("*") {
-                val headers = multiMapOf(
-                    "server" to "Hexagon",
-                    "date" to now().toHttpFormat(),
-                )
-
-                send(headers = headers)
+                send(headers = headers + Header("date", now().toHttpFormat()))
             }
 
             get("/plaintext") { ok(settings.textMessage, contentType = plain) }
             get("/json") { ok(Message(settings.textMessage).serialize(Json.raw), contentType = json) }
-
-            stores.forEach { (storeEngine, store) ->
-                path("/$storeEngine") {
-                    templateEngines.forEach { (templateEngineId, templateEngine) ->
-                        val templateUrl = templates.require(templateEngineId)
-                        get("/${templateEngineId}/fortunes") { listFortunes(store, templateUrl, templateEngine) }
-                    }
-
-                    get("/db") { dbQuery(store) }
-                    get("/query") { getWorlds(store) }
-                    get("/cached") { getCachedWorlds(store) }
-                    get("/update") { updateWorlds(store) }
-                }
-            }
+            get("/fortunes") { listFortunes(store, templateUrl, templateEngine) }
+            get("/db") { dbQuery(store) }
+            get("/query") { getWorlds(store) }
+            get("/cached-queries") { getCachedWorlds(store) }
+            get("/update") { updateWorlds(store) }
         }
     }
 

+ 7 - 3
frameworks/Kotlin/hexagon/src/main/kotlin/WebListenerServer.kt

@@ -1,20 +1,24 @@
 package com.hexagonkt
 
-import com.hexagonkt.core.multiMapOf
+import com.hexagonkt.http.model.Header
+import com.hexagonkt.http.model.HttpFields
 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 jakarta.servlet.annotation.WebListener
 
 @WebListener class WebListenerServer(settings: Settings = Settings()) : ServletServer(createHandlers(settings)) {
 
     private companion object {
+        val headers = HttpFields(Header("server", "Tomcat"))
 
         fun createHandlers(settings: Settings): List<HttpHandler> {
-            val controller = Controller(settings, stores, templateEngines)
+            val controller = Controller(settings, BenchmarkSqlStore("postgresql"), PebbleAdapter)
             val controllerPath = controller.path
             val serverHeaderHandler = OnHandler("*") {
-                send(headers = multiMapOf("server" to "Tomcat"))
+                send(headers = headers)
             }
 
             return listOf(serverHeaderHandler, controllerPath)

+ 7 - 18
frameworks/Kotlin/hexagon/src/main/kotlin/store/BenchmarkSqlStore.kt

@@ -25,22 +25,11 @@ internal class BenchmarkSqlStore(engine: String, private val settings: Settings
         val environment = Jvm.systemSettingOrNull(String::class, "BENCHMARK_ENV")?.lowercase()
         val poolSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2
         val postgresqlSettings = listOf(
-            "useSSL=false",
-            "jdbcCompliantTruncation=false",
-            "elideSetAutoCommits=true",
-            "useLocalSessionState=true",
-            "cachePrepStmts=true",
-            "cacheCallableStmts=true",
-            "alwaysSendSetIsolation=false",
-            "prepStmtCacheSize=4096",
-            "cacheServerConfiguration=true",
-            "prepStmtCacheSqlLimit=2048",
-            "traceProtocol=false",
-            "useUnbufferedInput=false",
-            "useReadAheadInput=false",
-            "maintainTimeStats=false",
-            "useServerPrepStmts=true",
-            "cacheRSMetadata=true"
+            "ssl=false",
+            "assumeMinServerVersion=12.10",
+            "databaseMetadataCacheFieldsMiB=8",
+            "prepareThreshold=1",
+            "reWriteBatchedInserts=true",
         ).joinToString("&")
         val config = HikariConfig().apply {
             jdbcUrl = "jdbc:postgresql://$dbHost/${settings.databaseName}?$postgresqlSettings"
@@ -53,12 +42,12 @@ internal class BenchmarkSqlStore(engine: String, private val settings: Settings
     }
 
     override fun findAllFortunes(): List<Fortune> {
-        val fortunes = mutableListOf<Fortune>()
+        var fortunes = listOf<Fortune>()
 
         dataSource.connection.use { con: Connection ->
             val rs = con.prepareStatement(SELECT_ALL_FORTUNES).executeQuery()
             while (rs.next())
-                fortunes += Fortune(rs.getInt(1), rs.getString(2))
+                fortunes = fortunes + Fortune(rs.getInt(1), rs.getString(2))
         }
 
         return fortunes