From 8273f915692fcda1b28e4c69ed399ff50d8550b8 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 12 Jul 2024 09:52:30 +0100 Subject: Instrument the utility thread pool delays --- guix-build-coordinator/coordinator.scm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'guix-build-coordinator') 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 -- cgit v1.2.3