From eb07d3e0deed95eda76db9300b55a66c959133c6 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 24 Jun 2022 12:59:17 +0100 Subject: Add some instrumentation around the database --- scripts/nar-herder.in | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 8ade7fb..d1f95d1 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -211,8 +211,12 @@ (append %base-option-defaults %import-options-defaults) rest)) + (metrics-registry + (make-metrics-registry #:namespace + "narherder")) (database (setup-database - (assq-ref opts 'database)))) + (assq-ref opts 'database) + metrics-registry))) (let* ((narinfos (append-map (lambda (file-or-dir) @@ -258,8 +262,12 @@ (let* ((opts (parse-options %base-options %base-option-defaults rest)) + (metrics-registry + (make-metrics-registry #:namespace + "narherder")) (database (setup-database - (assq-ref opts 'database))) + (assq-ref opts 'database) + metrics-registry)) (lgr (make )) (port-log (make #:port (current-output-port) @@ -287,8 +295,7 @@ (remove-nar-files-by-hash database (assq-ref opts 'storage) - (make-metrics-registry #:namespace - "narherder") + metrics-registry (store-path-hash-part store-path))) (log-msg 'WARN "no --storage set, so just removing from the database")) @@ -386,7 +393,8 @@ #f) (download-database))))) - (let ((database (setup-database (assq-ref opts 'database))) + (let ((database (setup-database (assq-ref opts 'database) + metrics-registry)) (canonical-storage (and=> (assq-ref opts 'storage) canonicalize-path))) -- cgit v1.2.3