Skip to content

Commit

Permalink
Merge branch 'master' into pace
Browse files Browse the repository at this point in the history
  • Loading branch information
bojand committed Oct 29, 2020
2 parents 1fbc366 + 61422fc commit fff27be
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,13 +615,9 @@ func WithTemplateFuncs(funcMap template.FuncMap) Option {

// NewConfig creates a new RunConfig from the options passed
func NewConfig(call, host string, options ...Option) (*RunConfig, error) {
call = strings.TrimSpace(call)
host = strings.TrimSpace(host)

// init with defaults
c := &RunConfig{
call: call,
host: host,
n: 200,
c: 50,
nConns: 1,
Expand All @@ -641,6 +637,16 @@ func NewConfig(call, host string, options ...Option) (*RunConfig, error) {
}
}

// host and call may have been applied via options
// only override if not present
if c.host == "" {
c.host = strings.TrimSpace(host)
}

if c.call == "" {
c.call = strings.TrimSpace(call)
}

// fix up durations
if c.z > 0 {
c.n = math.MaxInt32
Expand Down

0 comments on commit fff27be

Please sign in to comment.