From: Siraaj Khandkar Date: Mon, 22 Mar 2021 15:52:35 +0000 (-0400) Subject: Measure and report timeline download time X-Git-Tag: 0.13.1~1 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=32dcc0b03ce0baeabaf5af599f26e290f49f2cdd;p=tt.git Measure and report timeline download time --- 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