Avoid spurious division-by-zero
This commit is contained in:
parent
c71ea5aaed
commit
efa64eec14
|
@ -113,7 +113,9 @@
|
||||||
(loop (+ count 1))
|
(loop (+ count 1))
|
||||||
(when record-results?
|
(when record-results?
|
||||||
(let* ((elapsed-sec (/ (- now start-time) 1000.0))
|
(let* ((elapsed-sec (/ (- now start-time) 1000.0))
|
||||||
(roundtrip-latency (/ elapsed-sec count)))
|
(roundtrip-latency (if (zero? count)
|
||||||
|
elapsed-sec
|
||||||
|
(/ elapsed-sec count))))
|
||||||
(write-logbook-datum! Tping (list (connection-count)
|
(write-logbook-datum! Tping (list (connection-count)
|
||||||
roundtrip-latency
|
roundtrip-latency
|
||||||
(/ 1.0 roundtrip-latency)
|
(/ 1.0 roundtrip-latency)
|
||||||
|
|
Loading…
Reference in New Issue