Skip to content

Commit 9061461

Browse files
committedSep 2, 2016
all: rename the tool to hey, add minor fixes
DO NOT MERGE It was a mistake that this tool has been published with the same name as tarekziade's boom. To avoid the conflict, we should rename the tool at the cost of breaking the existing users. Fixes #130.
1 parent e721321 commit 9061461

File tree

7 files changed

+50
-92
lines changed

7 files changed

+50
-92
lines changed
 

‎LICENSE

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Apache License
32
Version 2.0, January 2004
43
http://www.apache.org/licenses/
@@ -179,15 +178,15 @@
179178
APPENDIX: How to apply the Apache License to your work.
180179

181180
To apply the Apache License to your work, attach the following
182-
boilerplate notice, with the fields enclosed by brackets "[]"
181+
boilerplate notice, with the fields enclosed by brackets "{}"
183182
replaced with your own identifying information. (Don't include
184183
the brackets!) The text should be enclosed in the appropriate
185184
comment syntax for the file format. We also recommend that a
186185
file or class name and description of purpose be included on the
187186
same "printed page" as the copyright notice for easier
188187
identification within third-party archives.
189188

190-
Copyright 2014 Google Inc.
189+
Copyright {yyyy} {name of copyright owner}
191190

192191
Licensed under the Apache License, Version 2.0 (the "License");
193192
you may not use this file except in compliance with the License.
@@ -200,3 +199,4 @@
200199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201200
See the License for the specific language governing permissions and
202201
limitations under the License.
202+

‎README.md

+23-66
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1-
# boom
1+
# hey
22

33
[![Build Status](https://travis-ci.org/rakyll/boom.png?branch=master)](https://travis-ci.org/rakyll/boom)
44

5-
Boom is a tiny program that sends some load to a web application. It's similar to Apache Bench ([ab](http://httpd.apache.org/docs/2.2/programs/ab.html)), but with better availability across different platforms and a less troubling installation experience.
5+
hey is a tiny program that sends some load to a web application.
6+
It's similar to Apache Bench ([ab](http://httpd.apache.org/docs/2.2/programs/ab.html)),
7+
but with better availability across different platforms and a less troubling
8+
installation experience if you have [Go](http://golang.org/) installed.
69

7-
Boom is originally written by Tarek Ziade in Python and is available on [tarekziade/boom](https://github.com/tarekziade/boom). But, due to its dependency requirements and my personal annoyance of maintaining concurrent programs in Python, I decided to rewrite it in Go.
10+
hey was originally called boom and was influnced from Tarek Ziade's
11+
tool at [tarekziade/boom](https://github.com/tarekziade/boom).
812

9-
## Installation
13+
Using the same name was a mistake as it resulted in cases
14+
where binary name conflicts created confusion.
15+
To preserve the name for its original owner, we renamed this project to hey.
1016

11-
Simple as it takes to type the following command:
17+
## Installation
1218

13-
go get github.com/rakyll/boom
19+
go get github.com/rakyll/hey
1420

1521
## Usage
1622

17-
Boom supports custom headers, request body and basic authentication. It runs provided number of requests in the provided concurrency level, and prints stats.
18-
~~~
19-
Usage: boom [options...] <url>
23+
hey runs provided number of requests in the provided concurrency level and prints stats.
24+
25+
It also supports HTTP2 endpoints.
26+
27+
```
28+
Usage: hey [options...] <url>
2029
2130
Options:
2231
-n Number of requests to run.
@@ -37,64 +46,12 @@ Options:
3746
-a Basic authentication, username:password.
3847
-x HTTP Proxy address as host:port.
3948
49+
-h2 Make HTTP/2 requests.
50+
4051
-disable-compression Disable compression.
4152
-disable-keepalive Disable keep-alive, prevents re-use of TCP
4253
connections between different HTTP requests.
4354
-cpus Number of used cpu cores.
44-
(default for current machine is 1 cores)
45-
~~~
46-
47-
This is what happens when you run Boom:
48-
49-
% boom -n 1000 -c 100 https://google.com
50-
1000 / 1000 ∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎ 100.00 %
51-
52-
Summary:
53-
Total: 21.1307 secs.
54-
Slowest: 2.9959 secs.
55-
Fastest: 0.9868 secs.
56-
Average: 2.0827 secs.
57-
Requests/sec: 47.3246
58-
Speed index: Hahahaha
59-
60-
Response time histogram:
61-
0.987 [1] |
62-
1.188 [2] |
63-
1.389 [3] |
64-
1.590 [18] |∎∎
65-
1.790 [85] |∎∎∎∎∎∎∎∎∎∎∎
66-
1.991 [244] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
67-
2.192 [284] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
68-
2.393 [304] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
69-
2.594 [50] |∎∎∎∎∎∎
70-
2.795 [5] |
71-
2.996 [4] |
72-
73-
Latency distribution:
74-
10% in 1.7607 secs.
75-
25% in 1.9770 secs.
76-
50% in 2.0961 secs.
77-
75% in 2.2385 secs.
78-
90% in 2.3681 secs.
79-
95% in 2.4451 secs.
80-
99% in 2.5393 secs.
81-
82-
Status code distribution:
83-
[200] 1000 responses
84-
85-
## License
86-
87-
Copyright 2014 Google Inc. All Rights Reserved.
88-
89-
Licensed under the Apache License, Version 2.0 (the "License");
90-
you may not use this file except in compliance with the License.
91-
You may obtain a copy of the License at
92-
93-
http://www.apache.org/licenses/LICENSE-2.0
94-
95-
Unless required by applicable law or agreed to in writing, software
96-
distributed under the License is distributed on an "AS IS" BASIS,
97-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
98-
See the License for the specific language governing permissions and
99-
limitations under the License. ![Analytics](https://ga-beacon.appspot.com/UA-46881978-1/boom?pixel)
100-
55+
(default for current machine is 8 cores)
56+
-host HTTP Host header.
57+
```

‎boom.go ‎hey.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
// Command hey is an HTTP load generator.
1516
package main
1617

1718
import (
@@ -24,7 +25,7 @@ import (
2425
"runtime"
2526
"strings"
2627

27-
"github.com/rakyll/boom/boomer"
28+
"github.com/rakyll/hey/requester"
2829
)
2930

3031
const (
@@ -69,7 +70,7 @@ var (
6970
proxyAddr = flag.String("x", "", "")
7071
)
7172

72-
var usage = `Usage: boom [options...] <url>
73+
var usage = `Usage: hey [options...] <url>
7374
7475
Options:
7576
-n Number of requests to run.
@@ -90,7 +91,7 @@ Options:
9091
-a Basic authentication, username:password.
9192
-x HTTP Proxy address as host:port.
9293
93-
-h2 Make HTTP/2 requests.
94+
-h2 Enable HTTP/2.
9495
9596
-disable-compression Disable compression.
9697
-disable-keepalive Disable keep-alive, prevents re-use of TCP
@@ -185,7 +186,7 @@ func main() {
185186
req.Host = *hostHeader
186187
}
187188

188-
(&boomer.Boomer{
189+
(&requester.Work{
189190
Request: req,
190191
RequestBody: *body,
191192
N: num,

‎boom_test.go ‎hey_test.go

File renamed without changes.

‎boomer/print.go ‎requester/print.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package boomer
15+
package requester
1616

1717
import (
1818
"fmt"

‎boomer/boomer.go ‎requester/requester.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Package boomer provides commands to run load tests and display results.
16-
package boomer
15+
// Package requester provides commands to run load tests and display results.
16+
package requester
1717

1818
import (
1919
"crypto/tls"
@@ -37,7 +37,7 @@ type result struct {
3737
contentLength int64
3838
}
3939

40-
type Boomer struct {
40+
type Work struct {
4141
// Request is the request to be made.
4242
Request *http.Request
4343

@@ -77,7 +77,7 @@ type Boomer struct {
7777

7878
// Run makes all the requests, prints the summary. It blocks until
7979
// all work is done.
80-
func (b *Boomer) Run() {
80+
func (b *Work) Run() {
8181
b.results = make(chan *result, b.N)
8282

8383
start := time.Now()
@@ -96,7 +96,7 @@ func (b *Boomer) Run() {
9696
close(b.results)
9797
}
9898

99-
func (b *Boomer) makeRequest(c *http.Client) {
99+
func (b *Work) makeRequest(c *http.Client) {
100100
s := time.Now()
101101
var size int64
102102
var code int
@@ -116,7 +116,7 @@ func (b *Boomer) makeRequest(c *http.Client) {
116116
}
117117
}
118118

119-
func (b *Boomer) runWorker(n int) {
119+
func (b *Work) runWorker(n int) {
120120
var throttle <-chan time.Time
121121
if b.Qps > 0 {
122122
throttle = time.Tick(time.Duration(1e6/(b.Qps)) * time.Microsecond)
@@ -146,7 +146,7 @@ func (b *Boomer) runWorker(n int) {
146146
}
147147
}
148148

149-
func (b *Boomer) runWorkers() {
149+
func (b *Work) runWorkers() {
150150
var wg sync.WaitGroup
151151
wg.Add(b.C)
152152

‎boomer/boomer_test.go ‎requester/requester_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package boomer
15+
package requester
1616

1717
import (
1818
"bytes"
@@ -34,12 +34,12 @@ func TestN(t *testing.T) {
3434
defer server.Close()
3535

3636
req, _ := http.NewRequest("GET", server.URL, nil)
37-
boomer := &Boomer{
37+
w := &Work{
3838
Request: req,
3939
N: 20,
4040
C: 2,
4141
}
42-
boomer.Run()
42+
w.Run()
4343
if count != 20 {
4444
t.Errorf("Expected to boom 20 times, found %v", count)
4545
}
@@ -55,7 +55,7 @@ func TestQps(t *testing.T) {
5555
defer server.Close()
5656

5757
req, _ := http.NewRequest("GET", server.URL, nil)
58-
boomer := &Boomer{
58+
w := &Work{
5959
Request: req,
6060
N: 20,
6161
C: 2,
@@ -64,11 +64,11 @@ func TestQps(t *testing.T) {
6464
wg.Add(1)
6565
time.AfterFunc(time.Second, func() {
6666
if count > 1 {
67-
t.Errorf("Expected to boom 1 times, found %v", count)
67+
t.Errorf("Expected to work 1 times, found %v", count)
6868
}
6969
wg.Done()
7070
})
71-
go boomer.Run()
71+
go w.Run()
7272
wg.Wait()
7373
}
7474

@@ -90,12 +90,12 @@ func TestRequest(t *testing.T) {
9090
req, _ := http.NewRequest("GET", server.URL, nil)
9191
req.Header = header
9292
req.SetBasicAuth("username", "password")
93-
boomer := &Boomer{
93+
w := &Work{
9494
Request: req,
9595
N: 1,
9696
C: 1,
9797
}
98-
boomer.Run()
98+
w.Run()
9999
if uri != "/" {
100100
t.Errorf("Uri is expected to be /, %v is found", uri)
101101
}
@@ -122,14 +122,14 @@ func TestBody(t *testing.T) {
122122
defer server.Close()
123123

124124
req, _ := http.NewRequest("POST", server.URL, bytes.NewBuffer([]byte("Body")))
125-
boomer := &Boomer{
125+
w := &Work{
126126
Request: req,
127127
RequestBody: "Body",
128128
N: 10,
129129
C: 1,
130130
}
131-
boomer.Run()
131+
w.Run()
132132
if count != 10 {
133-
t.Errorf("Expected to boom 10 times, found %v", count)
133+
t.Errorf("Expected to work 10 times, found %v", count)
134134
}
135135
}

0 commit comments

Comments
 (0)
Please sign in to comment.