aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-05-14 22:45:19 +0100
committerChristopher Baines <mail@cbaines.net>2023-05-14 22:45:19 +0100
commit61f66193138322f724fc91ba2e89165574b26009 (patch)
tree4ca99174264838b15faf461c3d336a3cde3420b0 /guix-data-service
parentbbacbcd2aa712613f5fde0e18c3cab474dd0f6ad (diff)
downloaddata-service-61f66193138322f724fc91ba2e89165574b26009.tar
data-service-61f66193138322f724fc91ba2e89165574b26009.tar.gz
Add Guile internal time metrics
As this will help identify when the service restarts.
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/web/controller.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm
index efdd92c..2b8d2b5 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -173,6 +173,17 @@
(gc-metrics-updater
(get-gc-metrics-updater registry)))
+ (define guile-time-metrics-updater
+ (let ((internal-real-time
+ (make-gauge-metric registry "guile_internal_real_time"))
+ (internal-run-time
+ (make-gauge-metric registry "guile_internal_run_time")))
+ (lambda ()
+ (metric-set internal-real-time
+ (get-internal-real-time))
+ (metric-set internal-run-time
+ (get-internal-run-time)))))
+
(lambda ()
(letpar& ((metric-values
(with-thread-postgresql-connection
@@ -279,6 +290,7 @@
load-new-guix-revision-job-metrics)
(gc-metrics-updater)
+ (guile-time-metrics-updater)
(list (build-response
#:code 200