Skip to content

Commit

Permalink
Added the skipFirst option for warmup delays
Browse files Browse the repository at this point in the history
  • Loading branch information
Sujit D'Mello committed Jul 10, 2020
1 parent 02c0138 commit 7782ba1
Show file tree
Hide file tree
Showing 7 changed files with 330 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Flags:
--key= File containing client private key, to present to the server. Must also provide -cert option.
--cname= Server name override when validating TLS certificate - useful for self signed certs.
--skipTLS Skip TLS client verification of the server's certificate chain and host name.
--skipFirst Skip the first X requests from the timing calculations (useful for initial warmup)
--insecure Use plaintext and insecure connection.
--authority= Value to be used as the :authority pseudo-header. Only works if -insecure is used.
-c, --concurrency=50 Number of requests to run concurrently. Total number of requests cannot be smaller than the concurrency level. Default is 50.
Expand Down
11 changes: 10 additions & 1 deletion cmd/ghz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ var (
skipVerify = kingpin.Flag("skipTLS", "Skip TLS client verification of the server's certificate chain and host name.").
Default("false").IsSetByUser(&isSkipSet).Bool()

isSkipFirstSet = false
skipFirst = kingpin.Flag("skipFirst", "Skip the first X requests when doing the results tally.").
Default("0").IsSetByUser(&isSkipFirstSet).Uint()

isInsecSet = false
insecure = kingpin.Flag("insecure", "Use plaintext and insecure connection.").
Default("false").IsSetByUser(&isInsecSet).Bool()
Expand Down Expand Up @@ -99,7 +103,7 @@ var (
Short('x').Default("0").IsSetByUser(&isXSet).Duration()

isZStopSet = false
zstop = kingpin.Flag("duration-stop", "Specifies how duration stop is reported. Options are close, wait or ignore.").
zstop = kingpin.Flag("duration-stop", "Specifies how duration stop is reported. Options are close, warnit or ignore.").
Default("close").IsSetByUser(&isZStopSet).String()

// Data
Expand Down Expand Up @@ -357,6 +361,7 @@ func createConfigFromArgs(cfg *runner.Config) error {
cfg.Cert = *cert
cfg.Key = *key
cfg.SkipTLSVerify = *skipVerify
cfg.SkipFirst = *skipFirst
cfg.Insecure = *insecure
cfg.Authority = *authority
cfg.CName = *cname
Expand Down Expand Up @@ -423,6 +428,10 @@ func mergeConfig(dest *runner.Config, src *runner.Config) error {
dest.SkipTLSVerify = src.SkipTLSVerify
}

if isSkipFirstSet {
dest.SkipFirst = src.SkipFirst
}

if isInsecSet {
dest.Insecure = src.Insecure
}
Expand Down
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,27 @@ require (
github.com/alecthomas/kingpin v1.3.8-0.20191105203113-8c96d1c22481
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/bojand/hri v1.1.0
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.16.0 // indirect
github.com/go-playground/validator v9.30.0+incompatible
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.3.2
github.com/golangci/golangci-lint v1.27.0 // indirect
github.com/google/uuid v1.1.1
github.com/jhump/protoreflect v1.5.0
github.com/jinzhu/configor v1.1.1
github.com/jinzhu/gorm v1.9.11
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0
github.com/leodido/go-urn v1.2.0 // indirect
github.com/mfridman/tparse v0.7.4 // indirect
github.com/pkg/errors v0.8.1
github.com/rakyll/statik v0.1.6
github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.5.1
go.uber.org/multierr v1.3.0
go.uber.org/zap v1.13.0
golang.org/x/net v0.0.0-20191021144547-ec77196f6094
golang.org/x/tools v0.0.0-20191127201027-ecd32218bd7f // indirect
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a // indirect
google.golang.org/grpc v1.24.0
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/yaml.v2 v2.2.4 // indirect
)
Loading

0 comments on commit 7782ba1

Please sign in to comment.