From 32dcc0b03ce0baeabaf5af599f26e290f49f2cdd Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Mon, 22 Mar 2021 11:52:35 -0400 Subject: [PATCH] Measure and report timeline download time --- tt.rkt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tt.rkt b/tt.rkt index b6b6bd5..f290eec 100644 --- a/tt.rkt +++ b/tt.rkt @@ -354,7 +354,7 @@ (define (feed-download f) (match-define (feed nick uri) f) (define u (url->string uri)) - (log-info "Downloading feed nick:~a uri:~a" nick u) + (log-info "Downloading feed uri:~a" u) (with-handlers ([exn:fail? (λ (e) @@ -366,7 +366,7 @@ #f)]) (define-values (_result _tm-cpu-ms tm-real-ms _tm-gc-ms) (time-apply uri-download (list uri))) - (log-info "Downloaded in ~a seconds, uri: ~a" (/ tm-real-ms 1000.0) u))) + (log-info "Feed downloaded in ~a seconds, uri: ~a" (/ tm-real-ms 1000.0) u))) (: timeline-download (-> Integer (Listof Feed) Void)) (define (timeline-download num-workers feeds) @@ -431,7 +431,11 @@ njobs "Number of concurrent jobs." (set! num-workers (string->number njobs))] #:args (filename) - (timeline-download num-workers (file->feeds filename))))] + (define-values (_res _cpu real-ms _gc) + (time-apply timeline-download (list num-workers (file->feeds filename)))) + ; TODO Sync with logger before exit + (eprintf "Timeline downloaded in ~a seconds.~n" (/ real-ms 1000.0)) + ))] [(or "u" "upload") (command-line #:program -- 2.20.1