File tree 3 files changed +20
-11
lines changed
3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ container it will automatically migrate that node to be the first node of the
57
57
multinode container with the name specified by XTDB_MIGRATION_NODE_NAME. If the
58
58
environment variable isn't specified it will default to "_dev".
59
59
60
+ === XTDB_QUERY_DEBUG
61
+
62
+ Setting this variable will log the duration of every query.
63
+
60
64
=== JAVA_TOOL_OPTIONS
61
65
62
66
This are the options for the JVM. This by default set to `-Xms128M -Xmx512M
Original file line number Diff line number Diff line change 568
568
(when (:help options)
569
569
(println summary)
570
570
(System/exit 0 ))
571
+ (when (System/getenv " XTDB_QUERY_DEBUG" )
572
+ (.setLevel (org.slf4j.LoggerFactory/getLogger " xtdb-http-multinode.query" ) (ch.qos.logback.classic.Level/valueOf " debug" )))
571
573
(let [port (:port options)
572
574
host (:host options)
573
575
server (j/run-jetty (rr/ring-handler (->xtdb-router {:http-options {}})
Original file line number Diff line number Diff line change 199
199
(let [{query-params :query body-params :body } (get-in req [:parameters ])
200
200
{:keys [valid-time tx-time tx-id query-edn in-args-edn in-args-json]} query-params
201
201
query (or query-edn (get body-params :query ))
202
- in-args (or in-args-edn in-args-json (get body-params :in-args ))]
203
- (-> (if (nil? query)
204
- (assoc options :no-query? true )
205
- (run-query (transform-req query req)
206
- in-args
207
- (assoc options
208
- :valid-time valid-time
209
- :tx-time tx-time
210
- :tx-id tx-id
211
- :xtdb-node (get req :xtdb-node ))))
212
- (transform-query-resp req)))
202
+ in-args (or in-args-edn in-args-json (get body-params :in-args ))
203
+ start-time (System/currentTimeMillis )
204
+ result (-> (if (nil? query)
205
+ (assoc options :no-query? true )
206
+ (run-query (transform-req query req)
207
+ in-args
208
+ (assoc options
209
+ :valid-time valid-time
210
+ :tx-time tx-time
211
+ :tx-id tx-id
212
+ :xtdb-node (get req :xtdb-node ))))
213
+ (transform-query-resp req))]
214
+ (log/debug " duration:" (- (System/currentTimeMillis ) start-time) " ms query:" query)
215
+ result)
213
216
214
217
(catch java.lang.AssertionError e
215
218
(log/debug e)
You can’t perform that action at this time.
0 commit comments