aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-06-21 15:47:32 +0200
committerChristopher Baines <mail@cbaines.net>2019-06-21 15:47:53 +0200
commit766656086f3dbaa97d30d96564c084a5a77b007e (patch)
tree6ec75845b970a5924af6b51fc282de3edcecfdfa
parent398b8aab05ec884b8bc3013d13031c1b79466f72 (diff)
downloaddata-service-766656086f3dbaa97d30d96564c084a5a77b007e.tar
data-service-766656086f3dbaa97d30d96564c084a5a77b007e.tar.gz
Add a couple of functions around timing
That don't rely on timing a single function.
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index bd675e4..2743519 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -40,6 +40,18 @@
action time-taken)
result))
+(define (record-start-time action)
+ (simple-format #t "debug: Starting ~A\n" action)
+ (cons action
+ (current-time)))
+
+(define record-end-time
+ (match-lambda
+ ((action . start-time)
+ (let ((time-taken (- (current-time) start-time)))
+ (simple-format #t "debug: Finished ~A, took ~A seconds\n"
+ action time-taken)))))
+
(define (all-inferior-package-derivations store inf packages)
(define inferior-%supported-systems
(inferior-eval '(@ (guix packages) %supported-systems) inf))