Use %.f not %.g to format stats interval.

fmt.Sprintf("%.g", 86400.4) → "9e+04"
fmt.Sprintf("%.f", 86400.4) → "86400"
This commit is contained in:
David Fifield 2017-10-20 12:25:19 -07:00
parent 085f253757
commit 9ab8ea3df4

View file

@ -32,7 +32,7 @@ func statsThread() {
numConnections += 1 numConnections += 1
case <-deadline: case <-deadline:
now := time.Now() now := time.Now()
log.Printf("in the past %.g s, %d/%d connections had client_ip", log.Printf("in the past %.f s, %d/%d connections had client_ip",
(now.Sub(prevTime)).Seconds(), (now.Sub(prevTime)).Seconds(),
numClientIP, numConnections) numClientIP, numConnections)
numClientIP = 0 numClientIP = 0