mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-26 12:39:36 -05:00
weather: Only show request statistics when requests were made.
This avoids the script crashing if all data is fetched from the cache. * guix/scripts/weather.scm (report-server-coverage): Only show request statistics when some requests have been made.
This commit is contained in:
parent
966e61fb8f
commit
806125e52f
1 changed files with 5 additions and 4 deletions
|
@ -212,10 +212,11 @@ (define MiB (* (expt 2 20) 1.))
|
|||
total)))))
|
||||
(format #t (G_ " ~,1h MiB on disk (uncompressed)~%")
|
||||
(/ (reduce + 0 (map narinfo-size narinfos)) MiB))
|
||||
(format #t (G_ " ~,3h seconds per request (~,1h seconds in total)~%")
|
||||
(/ time requests-made 1.) time)
|
||||
(format #t (G_ " ~,1h requests per second~%")
|
||||
(/ requests-made time 1.))
|
||||
(when (> requests-made 0)
|
||||
(format #t (G_ " ~,3h seconds per request (~,1h seconds in total)~%")
|
||||
(/ time requests-made 1.) time)
|
||||
(format #t (G_ " ~,1h requests per second~%")
|
||||
(/ requests-made time 1.)))
|
||||
|
||||
(guard (c ((http-get-error? c)
|
||||
(if (= 404 (http-get-error-code c))
|
||||
|
|
Loading…
Reference in a new issue