aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-09-11 13:24:57 +0100
committerChristopher Baines <mail@cbaines.net>2023-09-12 13:11:00 +0100
commit5997318263207a54c57f39357d0c261fd2d83c0f (patch)
treeea6c06f08e21c174068d0c15c2cb7a42885431a4
parenta9f3ed8769e22b134ef8e216057dd23b006eb95c (diff)
downloadnar-herder-5997318263207a54c57f39357d0c261fd2d83c0f.tar
nar-herder-5997318263207a54c57f39357d0c261fd2d83c0f.tar.gz
Log the procedure delayed for database operations
-rw-r--r--nar-herder/database.scm10
-rw-r--r--nar-herder/utils.scm3
2 files changed, 8 insertions, 5 deletions
diff --git a/nar-herder/database.scm b/nar-herder/database.scm
index 186ef6c..2bac86f 100644
--- a/nar-herder/database.scm
+++ b/nar-herder/database.scm
@@ -270,13 +270,14 @@ CREATE INDEX cached_narinfo_files_narinfo_id
(make-histogram-metric
metrics-registry
"database_read_delay_seconds")))
- (lambda (seconds-delayed)
+ (lambda (seconds-delayed proc)
(metric-observe delay-metric seconds-delayed)
(when (> seconds-delayed 1)
(display
(format
#f
- "warning: database read delayed by ~1,2f seconds~%"
+ "warning: database read (~a) delayed by ~1,2f seconds~%"
+ proc
seconds-delayed)
(current-error-port)))))
#:duration-logger
@@ -318,13 +319,14 @@ CREATE INDEX cached_narinfo_files_narinfo_id
(make-histogram-metric
metrics-registry
"database_write_delay_seconds")))
- (lambda (seconds-delayed)
+ (lambda (seconds-delayed proc)
(metric-observe delay-metric seconds-delayed)
(when (> seconds-delayed 1)
(display
(format
#f
- "warning: database write delayed by ~1,2f seconds~%"
+ "warning: database write (~a) delayed by ~1,2f seconds~%"
+ proc
seconds-delayed)
(current-error-port)))))
#:duration-logger
diff --git a/nar-herder/utils.scm b/nar-herder/utils.scm
index 371584e..f3bf5d4 100644
--- a/nar-herder/utils.scm
+++ b/nar-herder/utils.scm
@@ -473,7 +473,8 @@ falling back to en_US.utf8\n"
(- (get-internal-real-time)
sent-time)))
(delay-logger (/ time-delay
- internal-time-units-per-second))
+ internal-time-units-per-second)
+ proc)
(let* ((start-time (get-internal-real-time))
(response