diff options
author | Christopher Baines <mail@cbaines.net> | 2023-05-08 15:40:16 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-05-08 15:40:16 +0100 |
commit | 80eeab00c593f12553bd5b40af4523a088699792 (patch) | |
tree | a72db8206e7cd0dda16f4264c8d71683d7bb6112 /guix-build-coordinator/agent-messaging | |
parent | d030cace841a224d74dd3ec3ae12a14f8d516399 (diff) | |
download | build-coordinator-80eeab00c593f12553bd5b40af4523a088699792.tar build-coordinator-80eeab00c593f12553bd5b40af4523a088699792.tar.gz |
Expose the number threads as a metric
As I think this might want reducing at some point.
Diffstat (limited to 'guix-build-coordinator/agent-messaging')
-rw-r--r-- | guix-build-coordinator/agent-messaging/http/server.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/guix-build-coordinator/agent-messaging/http/server.scm b/guix-build-coordinator/agent-messaging/http/server.scm index 0ca97a6..12139c0 100644 --- a/guix-build-coordinator/agent-messaging/http/server.scm +++ b/guix-build-coordinator/agent-messaging/http/server.scm @@ -23,6 +23,7 @@ #:use-module (srfi srfi-19) #:use-module (ice-9 match) #:use-module (ice-9 ftw) + #:use-module (ice-9 threads) #:use-module (ice-9 format) #:use-module (ice-9 exceptions) #:use-module (ice-9 textual-ports) @@ -85,12 +86,19 @@ if there was no request body." (get-port-metrics-updater (build-coordinator-metrics-registry build-coordinator))) + (define thread-metric + (make-gauge-metric + (build-coordinator-metrics-registry build-coordinator) + "guile_threads_total")) + (define datastore-metrics-updater (base-datastore-metrics-updater build-coordinator)) (define (update-managed-metrics!) (call-with-delay-logging datastore-metrics-updater) (call-with-delay-logging gc-metrics-updater) + (metric-set thread-metric + (length (all-threads))) (call-with-delay-logging port-metrics-updater)) (call-with-error-handling |