Warn about long running requests
This commit is contained in:
parent
2bb5f4ccc4
commit
61780fe7ea
1 changed files with 15 additions and 0 deletions
|
|
@ -361,6 +361,21 @@ port. Also, the port used can be changed by passing the --port option.\n"
|
||||||
render-metrics)))))
|
render-metrics)))))
|
||||||
#:unwind? #t))
|
#:unwind? #t))
|
||||||
#:connection-buffer-size (expt 2 14)
|
#:connection-buffer-size (expt 2 14)
|
||||||
|
#:post-request-hook
|
||||||
|
(lambda* (request #:key read-request-time
|
||||||
|
response-end-time
|
||||||
|
#:allow-other-keys)
|
||||||
|
(let ((request-duration
|
||||||
|
(/ (- response-end-time
|
||||||
|
read-request-time)
|
||||||
|
internal-time-units-per-second)))
|
||||||
|
(when (> request-duration
|
||||||
|
30)
|
||||||
|
(format
|
||||||
|
(current-error-port)
|
||||||
|
"warning: ~a took ~f seconds to complete\n"
|
||||||
|
(uri-path (request-uri request))
|
||||||
|
request-duration))))
|
||||||
#:host host
|
#:host host
|
||||||
#:port port)))
|
#:port port)))
|
||||||
#:unwind? #t)))
|
#:unwind? #t)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue