aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-10-16 10:04:41 +0100
committerChristopher Baines <mail@cbaines.net>2023-10-16 10:04:41 +0100
commitffbba8e7d6d92c71c320dd5a152b956f56559e77 (patch)
treecbb3d87404bfe8f0abaa98e64700dedcf4d5fa33
parenta5f56845af7b51d6f968dc3824cfea84671126ec (diff)
downloadqa-frontpage-ffbba8e7d6d92c71c320dd5a152b956f56559e77.tar
qa-frontpage-ffbba8e7d6d92c71c320dd5a152b956f56559e77.tar.gz
Instrument the refresh patch data thread
-rw-r--r--guix-qa-frontpage/issue.scm9
-rw-r--r--scripts/guix-qa-frontpage.in1
2 files changed, 9 insertions, 1 deletions
diff --git a/guix-qa-frontpage/issue.scm b/guix-qa-frontpage/issue.scm
index 87d7a64..e0da210 100644
--- a/guix-qa-frontpage/issue.scm
+++ b/guix-qa-frontpage/issue.scm
@@ -21,6 +21,7 @@
#:use-module (srfi srfi-71)
#:use-module (ice-9 match)
#:use-module (ice-9 threads)
+ #:use-module (prometheus)
#:use-module ((guix-build-coordinator utils)
#:select (with-time-logging))
#:use-module ((guix build syscalls)
@@ -283,6 +284,7 @@
(define* (start-refresh-patch-branches-data-thread
database
+ metrics-registry
#:key
(number-of-series-to-refresh 250))
(define frequency
@@ -376,7 +378,12 @@
(lambda ()
(with-time-logging "refreshing data"
(with-throw-handler #t
- refresh-data
+ (lambda ()
+ (call-with-duration-metric
+ metrics-registry
+ "refresh_patch_branches_data_duration_seconds"
+ refresh-data
+ #: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 66ae1b0..256164a 100644
--- a/scripts/guix-qa-frontpage.in
+++ b/scripts/guix-qa-frontpage.in
@@ -277,6 +277,7 @@
(start-refresh-patch-branches-data-thread
database
+ metrics-registry
#:number-of-series-to-refresh
(+ patch-issues-to-show 50))
(start-refresh-non-patch-branches-data-thread database