Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

Updare readme, fix ugliness.

mdakina98ea5539699
diff --git a/README.md b/README.md
index 1c5465a..4b78e40 100644
--- a/README.md
+++ b/README.md
@@ -22,13 +22,16 @@ boom supports custom headers, request body and basic authentication. It runs pro
-n Number of requests to run.
-c Number of requests to run concurrently. Total number of requests cannot
be smaller than the concurency level.
+ -q Rate limit, in seconds (QPS).
+ -t Time limit in seconds. boom will stop after s seconds if specified.
-m HTTP method, one of GET, POST, PUT, DELETE, HEAD, OPTIONS.
-h Custom HTTP headers, name1:value1;name2:value2.
-d HTTP request body.
- -t Content-type, defaults to "text/html".
+ -T Content-type, defaults to "text/html".
-a Basic authentication, username:password.
+ -allow-insecure Allow bad/expired TLS/SSL certificates.
This is what happens when you run boom:
diff --git a/commands/print.go b/commands/print.go
index c278d40..6153358 100644
--- a/commands/print.go
+++ b/commands/print.go
@@ -27,11 +27,11 @@ func (r *report) update(res *result) {
r.avgTotal += res.duration.Seconds()
}
-func (r *report) finalize(b *Boom) {
+func (r *report) finalize(totalReq int) {
r.end = time.Now()
r.total = r.end.Sub(r.start)
- r.rps = float64(b.N) / r.total.Seconds()
- r.average = r.avgTotal / float64(b.N)
+ r.rps = float64(totalReq) / r.total.Seconds()
+ r.average = r.avgTotal / float64(totalReq)
}
func (r *report) Print() {
diff --git a/commands/run.go b/commands/run.go
index c0c2314..fa6b439 100644
--- a/commands/run.go
+++ b/commands/run.go
@@ -49,7 +49,7 @@ func (b *Boom) init() {
func (b *Boom) teardown() {
b.bar.Finish()
- b.rpt.finalize(b)
+ b.rpt.finalize(b.N)
}
func (b *Boom) worker(wg *sync.WaitGroup) {