aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-07-12 09:52:30 +0100
committerChristopher Baines <mail@cbaines.net>2024-07-12 09:52:30 +0100
commit8273f915692fcda1b28e4c69ed399ff50d8550b8 (patch)
tree3e9c76c760724a53d1089237f1c7c4aa98e24e64
parent1801466324223f9c48fcef9e8a58a161a33e2b58 (diff)
downloadbuild-coordinator-8273f915692fcda1b28e4c69ed399ff50d8550b8.tar
build-coordinator-8273f915692fcda1b28e4c69ed399ff50d8550b8.tar.gz
Instrument the utility thread pool delays
-rw-r--r--guix-build-coordinator/coordinator.scm21
1 files changed, 13 insertions, 8 deletions
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm
index c34d02b..a7fb664 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -507,14 +507,19 @@
#:name "utility"
#:parallelism 10
#:delay-logger
- (lambda (seconds-delayed)
- (log-delay "utility thread channel"
- seconds-delayed)
- (when (> seconds-delayed 0.1)
- (format
- (current-error-port)
- "warning: utility thread channel delayed by ~1,2f seconds~%"
- seconds-delayed))))))
+ (let ((delay-metric
+ (make-histogram-metric
+ (build-coordinator-metrics-registry build-coordinator)
+ "utility_thread_pool_delay_seconds")))
+ (lambda (seconds-delayed)
+ (log-delay "utility thread channel"
+ seconds-delayed)
+ (metric-observe delay-metric seconds-delayed)
+ (when (> seconds-delayed 0.1)
+ (format
+ (current-error-port)
+ "warning: utility thread channel delayed by ~1,2f seconds~%"
+ seconds-delayed)))))))
(let ((finished? (make-condition)))
(call-with-sigint