 (defn -main [& _]
   (let [ds (hikari/make-datasource
              {:read-only true
-              :maximum-pool-size 64
+              :maximum-pool-size 48
               :pool-name "db-pool"
               :adapter "postgresql"
               :username "benchmarkdbuser"

  (:require [immutant.web :as web]
            [hikari-cp.core :as hikari]
            [reitit.ring :as ring]
            [porsas.core :as p]
            [jsonista.core :as j])
  (:gen-class)


(defn blocking [handler]
  (fn [req]
    (let [exchange ^HttpServerExchange (:server-exchange req)]
      (if (.isInIoThread exchange)
        (.dispatch exchange ^Runnable ^:once (fn []
                                               (.startBlocking exchange)
                                               (immutant/write-response exchange (handler req))
                                               (.endExchange exchange)))
        (handler req)))))

(defn random []
  (unchecked-inc (.nextInt (ThreadLocalRandom/current) 10000)))
