Avoid spurious division by zero when fast servers (e.g. uv) are fast

This commit is contained in:
Tony Garnock-Jones 2015-03-18 23:19:31 -04:00
parent 38831969be
commit 855bbf77b8
1 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@
(/ elapsed-sec count))))
(write-logbook-datum! Tping (list (connection-count)
roundtrip-latency
(/ 1.0 roundtrip-latency)
(if (zero? roundtrip-latency) 0 (/ 1.0 roundtrip-latency))
count
elapsed-sec)))))))
@ -142,7 +142,7 @@
(define gc-sec (/ gc-time 1000.0))
(write-logbook-datum! Tgrowth (list old-count
(/ wallclock-sec (- waypoint old-count))
(/ (- waypoint old-count) wallclock-sec)
(if (zero? wallclock-sec) 0 (/ (- waypoint old-count) wallclock-sec))
cpu+gc-sec
wallclock-sec
gc-sec