aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/datastore
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-04-22 15:23:31 +0100
committerChristopher Baines <mail@cbaines.net>2023-04-22 15:23:31 +0100
commit8d524b656e9a8eff9390bb2936ad5ace84bc94b9 (patch)
treeb8ea4e192ee42ff5c8c5672b6f9ea37ff103d8a0 /guix-build-coordinator/datastore
parentcba5a6e918f2a3b9368df98a598a1d415dff94ee (diff)
downloadbuild-coordinator-8d524b656e9a8eff9390bb2936ad5ace84bc94b9.tar
build-coordinator-8d524b656e9a8eff9390bb2936ad5ace84bc94b9.tar.gz
Instrument the closing of writer threads
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm16
1 files changed, 10 insertions, 6 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 7a7cb1b..e8d9f2a 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -146,13 +146,17 @@
(sqlite-exec db "PRAGMA foreign_keys = ON;")
(list db)))
#:destructor
- (lambda (db)
- (db-optimize db
- database-file
- metrics-registry
- #:maybe-truncate-wal? #f)
+ (let ((writer-thread-destructor-counter
+ (make-gauge-metric metrics-registry
+ "datastore_writer_thread_close_total")))
+ (lambda (db)
+ (db-optimize db
+ database-file
+ metrics-registry
+ #:maybe-truncate-wal? #f)
- (sqlite-close db))
+ (metric-increment writer-thread-destructor-counter)
+ (sqlite-close db)))
#:lifetime 500
;; SQLite doesn't support parallel writes