aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/datastore
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-12-10 20:38:58 +0000
committerChristopher Baines <mail@cbaines.net>2020-12-10 20:38:58 +0000
commit22b2204187c7d8a0a6268ca8038b60fd5f5b825a (patch)
tree81bbe2131ae306089a0b44727e5e6002554b7ed5 /guix-build-coordinator/datastore
parentdfc3d8f487bcbbcbd6f857adfba3e1f0689fd7af (diff)
downloadbuild-coordinator-22b2204187c7d8a0a6268ca8038b60fd5f5b825a.tar
build-coordinator-22b2204187c7d8a0a6268ca8038b60fd5f5b825a.tar.gz
Add a default of 0 for the build allocation plan metric
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 626fd4e..4ecd83e 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -2025,10 +2025,11 @@ WHERE agent_id = :agent_id"
(slot-ref datastore 'metrics-registry)
"build_allocation_plan_total")))
(metric-set allocation-plan-metric
- (assoc-ref
- (datastore-count-build-allocation-plan-entries
- datastore)
- agent-id)
+ (or (assoc-ref
+ (datastore-count-build-allocation-plan-entries
+ datastore)
+ agent-id)
+ 0)
#:label-values
`((agent_id . ,agent-id)))))