Expose resource pool stats

This commit is contained in:
Christopher Baines 2023-07-09 18:06:57 +01:00
parent 899bd1387e
commit 75ef4cffd3
2 changed files with 52 additions and 20 deletions

View file

@ -68,9 +68,6 @@
(define registry
(make-metrics-registry #:namespace "guixdataservice"))
(define render-metrics
(make-render-metrics registry))
(%database-metrics-registry registry)
(let ((finished? (make-condition)))
@ -97,26 +94,29 @@
(resource-pool-default-timeout 10))
(with-exception-handler
(lambda (exn)
(simple-format
(current-error-port)
"\n
(let ((render-metrics
(make-render-metrics registry)))
(with-exception-handler
(lambda (exn)
(simple-format
(current-error-port)
"\n
error: guix-data-service could not start: ~A
Check if it's already running, or whether another process is using that
port. Also, the port used can be changed by passing the --port option.\n"
exn)
(primitive-exit 1))
(lambda ()
(run-server/patched
(lambda (request body)
(handler request body controller
secret-key-base
startup-completed
render-metrics))
#:host host
#:port port))
#:unwind? #t))
exn)
(primitive-exit 1))
(lambda ()
(run-server/patched
(lambda (request body)
(handler request body controller
secret-key-base
startup-completed
render-metrics))
#:host host
#:port port))
#:unwind? #t)))
(wait finished?))))
finished?)))