diff options
author | Christopher Baines <mail@cbaines.net> | 2024-07-02 23:54:24 +0200 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-07-04 10:33:29 +0200 |
commit | 587cc5cd3bee9daeba0ccbba06fba20c40636a6e (patch) | |
tree | def6601a802652ab07ea2a40f7df8e5539518545 | |
parent | ba3995ebe3c740ffb8cea8d65ba8faf54c04b7ef (diff) | |
download | build-coordinator-587cc5cd3bee9daeba0ccbba06fba20c40636a6e.tar build-coordinator-587cc5cd3bee9daeba0ccbba06fba20c40636a6e.tar.gz |
Revert "Add dbstat metrics"
It's not fast enough.
This reverts commit 09daad84faea3577acf5f1627e4bfed699b10a5d.
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm index 3e20e6f..ac04362 100644 --- a/guix-build-coordinator/datastore/sqlite.scm +++ b/guix-build-coordinator/datastore/sqlite.scm @@ -351,59 +351,6 @@ PRAGMA optimize;") (spawn-fiber (lambda () - (let* ((registry - (slot-ref datastore 'metrics-registry)) - (dbstat-metrics - (map - (lambda (name) - (let ((metric-name - (string-append "datastore_dbstat_" - (symbol->string name)))) - (cons - name - (or (metrics-registry-fetch-metric registry - metric-name) - (make-gauge-metric registry metric-name - #:labels '(name)))))) - '(pageno ncell payload unused mx_payload pgsize)))) - - (while #t - (with-exception-handler - (lambda (exn) - (simple-format - (current-error-port) - "exception fetching dbstat metrics: ~A\n" exn)) - (lambda () - (call-with-worker-thread - (slot-ref datastore 'worker-reader-thread-channel) - (lambda (db) - (let ((statement - (sqlite-prepare - db - " -SELECT * FROM dbstat WHERE aggregate = true" - #:cache? #t)) - (dbstat-columns - '(#f #f pageno #f ncell payload unused mx_payload #f pgsize))) - (sqlite-fold - (lambda (row _) - (for-each - (lambda (column val) - (when column - (metric-set (assq-ref dbstat-metrics column) - val - #:label-values - `((name . ,(vector-ref row 0)))))) - dbstat-columns - (vector->list row))) - #f - statement) - (sqlite-reset statement)))) - (sleep (* 60 60 60))) - #:unwind? #t))))) - - (spawn-fiber - (lambda () (while #t (sleep 20) (vector-for-each |