diff options
author | Christopher Baines <mail@cbaines.net> | 2020-05-19 19:11:26 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-05-19 19:11:26 +0100 |
commit | 6bfc8020d81d7b295aea41aabd0a2dc4d5e614dc (patch) | |
tree | 0de709224fe0ec3faeda792482505003b156144b /guix-build-coordinator/agent-messaging | |
parent | 4d308729c83869566ea07b7aae03f2cdef405cf1 (diff) | |
download | build-coordinator-6bfc8020d81d7b295aea41aabd0a2dc4d5e614dc.tar build-coordinator-6bfc8020d81d7b295aea41aabd0a2dc4d5e614dc.tar.gz |
Zero the allocated build counts for each agent
Otherwise old values persist if an agent has no allocated builds.
Diffstat (limited to 'guix-build-coordinator/agent-messaging')
-rw-r--r-- | guix-build-coordinator/agent-messaging/http.scm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/guix-build-coordinator/agent-messaging/http.scm b/guix-build-coordinator/agent-messaging/http.scm index 7e1b540..6c67d0d 100644 --- a/guix-build-coordinator/agent-messaging/http.scm +++ b/guix-build-coordinator/agent-messaging/http.scm @@ -177,6 +177,13 @@ port. Also, the port used can be changed by passing the --port option.\n" (lambda () (metric-set builds-total (datastore-count-builds datastore)) + + (for-each (lambda (agent-details) + (metric-set allocated-builds-total + 0 + #:label-values + `((agent_id . ,(assq-ref agent-details 'uuid))))) + (datastore-list-agents datastore)) (for-each (match-lambda ((agent-id . count) (metric-set allocated-builds-total |