Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

Convert average to secs.

Burcu Dogan32d69a5b69ab
diff --git a/commands/print.go b/commands/print.go
index fb82a3e..e96b709 100644
--- a/commands/print.go
+++ b/commands/print.go
@@ -2,6 +2,7 @@ package commands
import (
"fmt"
+ "math"
"time"
)
@@ -35,7 +36,7 @@ func (b *Boom) Print() {
fmt.Printf(" total:\t%v secs\n", total.Seconds())
fmt.Printf(" slowest:\t%v secs\n", slowest.Seconds())
fmt.Printf(" fastest:\t%v secs\n", fastest.Seconds())
- fmt.Printf(" average:\t%v nanoseconds\n", avgTotal/int64(b.N)) // TODO: in seconds
+ fmt.Printf(" average:\t%v secs\n", float64(avgTotal)/float64(b.N)*math.Pow(10, 9)) // TODO: in seconds
fmt.Printf(" requests/sec:\t%v\n", rps)
fmt.Printf(" speed index:\t%v\n", speedIndex(rps))
return