diff options
author | Christopher Baines <mail@cbaines.net> | 2022-06-24 12:59:17 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-06-24 12:59:17 +0100 |
commit | eb07d3e0deed95eda76db9300b55a66c959133c6 (patch) | |
tree | e5c004b2b61d3b1fe9ef7a401a141d8d1630ce3c /scripts | |
parent | d2af6b74bd6f5523dae237029a92c2ccd308fa13 (diff) | |
download | nar-herder-eb07d3e0deed95eda76db9300b55a66c959133c6.tar nar-herder-eb07d3e0deed95eda76db9300b55a66c959133c6.tar.gz |
Add some instrumentation around the database
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/nar-herder.in | 18 |
1 files changed, 13 insertions, 5 deletions
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 <logger>)) (port-log (make <port-log> #: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))) |