Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

apply for pull request

Artem Andreenkoebef8dbc2ef2
diff --git a/README.md b/README.md
index 3b78c86..92de4d4 100644
--- a/README.md
+++ b/README.md
@@ -33,9 +33,10 @@ Options:
-T Content-type, defaults to "text/html".
-a Basic authentication, username:password.
- -allow-insecure Allow bad/expired TLS/SSL certificates.
+ -allow-insecure Allow bad/expired TLS/SSL certificates.
-disable-compression Disable compression
-disable-keepalive Disable keep-alive, prevents re-use of TCP connections between different HTTP requests
+
-cpus Number of used cpu cores (default for current machine is %d cores)
~~~
diff --git a/boom.go b/boom.go
index c1ed1b5..d476335 100644
--- a/boom.go
+++ b/boom.go
@@ -22,8 +22,8 @@ import (
gourl "net/url"
"os"
"regexp"
- "strings"
"runtime"
+ "strings"
"github.com/miolini/boom/boomer"
)
@@ -38,11 +38,11 @@ var (
flagOutput = flag.String("o", "", "")
flagProxyAddr = flag.String("x", "", "")
- flagC = flag.Int("c", 50, "")
- flagN = flag.Int("n", 200, "")
- flagQ = flag.Int("q", 0, "")
- flagT = flag.Int("t", 0, "")
- flagCpus = flag.Int("cpus", runtime.NumCPU(), "")
+ flagC = flag.Int("c", 50, "")
+ flagN = flag.Int("n", 200, "")
+ flagQ = flag.Int("q", 0, "")
+ flagT = flag.Int("t", 0, "")
+ flagCpus = flag.Int("cpus", runtime.GOMAXPROCS(-1), "")
flagInsecure = flag.Bool("allow-insecure", false, "")
flagDisableCompression = flag.Bool("disable-compression", false, "")
@@ -93,7 +93,7 @@ func (*netDnsResolver) Lookup(domain string) (addr []string, err error) {
func main() {
flag.Usage = func() {
- fmt.Fprintf(os.Stderr, usage, runtime.NumCPU())
+ fmt.Fprintf(os.Stderr, usage, runtime.GOMAXPROCS(-1))
}
flag.Parse()
diff --git a/boomer/boomer.go b/boomer/boomer.go
index bb3de8d..61fe17c 100644
--- a/boomer/boomer.go
+++ b/boomer/boomer.go
@@ -70,7 +70,7 @@ type Boomer struct {
// Option to allow insecure TLS/SSL certificates.
AllowInsecure bool
- // Option to disable decompress response
+ // Option to disable compression in response
DisableCompression bool
// Option to prevents re-use of TCP connections between different HTTP requests