codesenberg / bombardier

Fast cross-platform HTTP benchmarking tool written in Go
MIT License
6.03k stars 315 forks source link

show realtime QPS when Bombarding #42

Closed pugwoo closed 5 years ago

pugwoo commented 5 years ago

beside the processing bar, thanks

codesenberg commented 5 years ago

Sure, looks doable, but the library bombardier uses for progress bar does not seem to provide any easy way to do this with tests limited by time. Fairly trivial to turn on for tests with capped request count. Here's the patch if you want to check it out:

diff --git a/bombardier.go b/bombardier.go
index a0b4fbf..b686cd2 100644
--- a/bombardier.go
+++ b/bombardier.go
@@ -70,6 +70,7 @@ func newBombardier(c config) (*bombardier, error) {

        if b.conf.testType() == counted {
                b.bar = pb.New64(int64(*b.conf.numReqs))
+               b.bar.ShowSpeed = true
        } else if b.conf.testType() == timed {
                b.bar = pb.New64(b.conf.duration.Nanoseconds() / 1e9)
                b.bar.ShowCounters = false