aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-10-06 11:31:14 +0100
committerChristopher Baines <mail@cbaines.net>2023-10-06 11:31:14 +0100
commitdb4344f6429139cf082fe400bcb24d1fb7c1cade (patch)
treeca3bc819cb45921df81e7acc82db5b12be347df2
parent3f289bcb7e58f8c3061c5b7ccf8786d7b456b893 (diff)
downloadqa-frontpage-db4344f6429139cf082fe400bcb24d1fb7c1cade.tar
qa-frontpage-db4344f6429139cf082fe400bcb24d1fb7c1cade.tar.gz
Instrument manage patch branches
-rw-r--r--guix-qa-frontpage/manage-patch-branches.scm9
-rw-r--r--scripts/guix-qa-frontpage.in1
2 files changed, 9 insertions, 1 deletions
diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm
index 7764375..88601b4 100644
--- a/guix-qa-frontpage/manage-patch-branches.scm
+++ b/guix-qa-frontpage/manage-patch-branches.scm
@@ -11,6 +11,7 @@
#:use-module (web uri)
#:use-module (web client)
#:use-module (json)
+ #:use-module (prometheus)
#:use-module (guix sets)
#:use-module (guix memoization)
#:use-module (guix build utils)
@@ -284,6 +285,7 @@
#:remove-after? #t)))
(define* (start-manage-patch-branches-thread database
+ metrics-registry
#:key (series-count 200))
(define (dig alist . parts)
(if (pair? alist)
@@ -484,7 +486,12 @@
exn))
(lambda ()
(with-throw-handler #t
- perform-pass
+ (lambda ()
+ (call-with-duration-metric
+ metrics-registry
+ "manage_patch_branches_duration_seconds"
+ perform-pass
+ #:buckets (list 30 60 120 240 480 960 1920 3840 (inf))))
(lambda args
(display (backtrace) (current-error-port))
(newline (current-error-port)))))
diff --git a/scripts/guix-qa-frontpage.in b/scripts/guix-qa-frontpage.in
index 2e82c7a..2fe36bf 100644
--- a/scripts/guix-qa-frontpage.in
+++ b/scripts/guix-qa-frontpage.in
@@ -297,6 +297,7 @@
(when (assq-ref opts 'manage-patch-branches)
(start-manage-patch-branches-thread database
+ metrics-registry
#:series-count patch-issues-to-show))
(start-guix-qa-frontpage