Skip to content

Commit

Permalink
support time duration literal
Browse files Browse the repository at this point in the history
  • Loading branch information
gmemcc committed Mar 12, 2019
1 parent 17e6f35 commit b5932e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/loadtester/task_ngrinder.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ func init() {
if err != nil {
return nil, errors.New("metadata auth provided is invalid, base64 encoded username:password required")
}
interval, err := strconv.Atoi(pollInterval)
interval, err := time.ParseDuration(pollInterval)
if err != nil {
interval = 1
}

return &NGrinderTask{
TaskBase{canary, logger},
baseUrl, cloneId, username, string(passwdDecoded), -1, time.Duration(interval),
baseUrl, cloneId, username, string(passwdDecoded), -1, interval,
}, nil
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/loadtester/task_ngrinder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestTaskNGrinder(t *testing.T) {
"clone": cloneId,
"username": "admin",
"passwd": "YWRtaW4=",
"pollInterval": "1",
"pollInterval": "1s",
}, canary, logger)
if err != nil {
t.Fatalf("Failed to create ngrinder task: %s", err.Error())
Expand Down

0 comments on commit b5932e8

Please sign in to comment.