Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,14 @@ func WithCPUMax(max int) Option {
func WithCPUSamplingTime(duration string) Option {
return optionFunc(func(opts *options) (err error) {
// CPUSamplingTime wouldn't be zero value, because it
// will be initialized as defaultInterval at newOptions()
// will be initialized as defaultCPUSamplingTime at newOptions()
newDuration, err := time.ParseDuration(duration)
if err != nil {
return
}

if newDuration <= 0 {
newDuration = defaultInterval
newDuration = defaultCPUSamplingTime
}

opts.CPUSamplingTime = newDuration
Expand Down