diff options
Diffstat (limited to 'test/benchmarks/network')
-rw-r--r-- | test/benchmarks/network/httpd_test.go | 8 | ||||
-rw-r--r-- | test/benchmarks/network/nginx_test.go | 9 | ||||
-rw-r--r-- | test/benchmarks/network/node_test.go | 7 | ||||
-rw-r--r-- | test/benchmarks/network/ruby_test.go | 7 |
4 files changed, 26 insertions, 5 deletions
diff --git a/test/benchmarks/network/httpd_test.go b/test/benchmarks/network/httpd_test.go index aa300dabd..b07274662 100644 --- a/test/benchmarks/network/httpd_test.go +++ b/test/benchmarks/network/httpd_test.go @@ -82,9 +82,14 @@ func benchmarkHttpdDocSize(b *testing.B, reverse bool) { if err != nil { b.Fatalf("Failed to parse parameters: %v", err) } + requests := b.N + if requests < c { + b.Logf("b.N is %d must be greater than threads %d. Consider running with --test.benchtime=Nx where N >= %d", b.N, c, c) + requests = c + } b.Run(name, func(b *testing.B) { hey := &tools.Hey{ - Requests: c * b.N, + Requests: requests, Concurrency: c, Doc: filename, } @@ -116,6 +121,7 @@ func benchmarkHttpdContinuous(b *testing.B, concurrency []int, sizes []string, r requests := b.N if requests < c { + b.Logf("b.N is %d must be greater than threads %d. Consider running with --test.benchtime=Nx where N >= %d", b.N, c, c) requests = c } b.Run(name, func(b *testing.B) { diff --git a/test/benchmarks/network/nginx_test.go b/test/benchmarks/network/nginx_test.go index 6e7a4dec4..87449612a 100644 --- a/test/benchmarks/network/nginx_test.go +++ b/test/benchmarks/network/nginx_test.go @@ -92,9 +92,14 @@ func benchmarkNginxDocSize(b *testing.B, reverse, tmpfs bool) { b.Fatalf("Failed to parse parameters: %v", err) } + requests := b.N + if requests < c { + b.Logf("b.N is %d must be greater than threads %d. Consider running with --test.benchtime=Nx where N >= %d", b.N, c, c) + requests = c + } b.Run(name, func(b *testing.B) { hey := &tools.Hey{ - Requests: c * b.N, + Requests: requests, Concurrency: c, Doc: filename, } @@ -128,9 +133,9 @@ func benchmarkNginxContinuous(b *testing.B, concurrency []int, sizes []string, r if err != nil { b.Fatalf("Failed to parse parameters: %v", err) } - requests := b.N if requests < c { + b.Logf("b.N is %d must be greater than threads %d. Consider running with --test.benchtime=Nx where N >= %d", b.N, c, c) requests = c } b.Run(name, func(b *testing.B) { diff --git a/test/benchmarks/network/node_test.go b/test/benchmarks/network/node_test.go index 246720d43..3e837a9e4 100644 --- a/test/benchmarks/network/node_test.go +++ b/test/benchmarks/network/node_test.go @@ -42,9 +42,14 @@ func BenchmarkNode(b *testing.B) { if err != nil { b.Fatalf("Failed to parse parameters: %v", err) } + requests := b.N + if requests < c { + b.Logf("b.N is %d must be greater than threads %d. Consider running with --test.benchtime=Nx where N >= %d", b.N, c, c) + requests = c + } b.Run(name, func(b *testing.B) { hey := &tools.Hey{ - Requests: b.N * c, // Requests b.N requests per thread. + Requests: requests, Concurrency: c, } runNode(b, hey) diff --git a/test/benchmarks/network/ruby_test.go b/test/benchmarks/network/ruby_test.go index 6f5199480..c89672873 100644 --- a/test/benchmarks/network/ruby_test.go +++ b/test/benchmarks/network/ruby_test.go @@ -43,9 +43,14 @@ func BenchmarkRuby(b *testing.B) { if err != nil { b.Fatalf("Failed to parse parameters: %v", err) } + requests := b.N + if requests < c { + b.Logf("b.N is %d must be greater than threads %d. Consider running with --test.benchtime=Nx where N >= %d", b.N, c, c) + requests = c + } b.Run(name, func(b *testing.B) { hey := &tools.Hey{ - Requests: b.N * c, // b.N requests per thread. + Requests: requests, Concurrency: c, } runRuby(b, hey) |