From 790be714a2b5f06b17cc74e1f740de623396784c Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 16 Feb 2022 16:32:01 +0100 Subject: fix display units --- go.mod | 6 +++++- htping.go | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 87d861f..5053ee0 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,8 @@ module github.com/leahneukirchen/htping go 1.14 -require github.com/prometheus/client_golang v1.5.1 +require ( + github.com/prometheus/client_golang v1.12.1 + golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect + google.golang.org/protobuf v1.27.1 // indirect +) diff --git a/htping.go b/htping.go index eca94b2..6cc0565 100644 --- a/htping.go +++ b/htping.go @@ -221,7 +221,7 @@ func ping(url string, seq int, myTransport *transport, results chan result) { durSummary.WithLabelValues(url, string(myTransport.addr)).Observe(dur) if !quiet { - fmt.Printf("%d bytes from %v: %s %d seq=%d time=%.3f ms\n", + fmt.Printf("%d bytes from %v: %s %d seq=%d time=%.3f s\n", written, myTransport.addr, res.Proto, @@ -271,7 +271,7 @@ func stats(results chan result, done chan bool) { if nrecv > 0 { mdev := math.Sqrt(sum2/float64(nrecv) - sum/float64(nrecv)*sum/float64(nrecv)) - fmt.Printf("rtt min/avg/max/mdev = %.3f/%.3f/%.3f/%.3f ms\n", + fmt.Printf("rtt min/avg/max/mdev = %.3f/%.3f/%.3f/%.3f s\n", min, sum/float64(nrecv), max, mdev) } -- cgit 1.4.1