-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify duration configurations #1305
Comments
The thresholds is another place in k6 where we have configuration of time duration values. Thankfully, that's also in milliseconds, but there's currently no way to use string-y units like |
|
This overhaul is also necessary for |
This seemingly normal script won't work as most people expect:
Because the request timeout doesn't understand stringy durations,
"2s"
would be converted to2
(because JavaScript 🤦♂️ ), so k6 would understand it as "2 milliseconds". So it's going to start to make a ton of requests instead of just 3...However this script also doesn't work like how you'd expect either:
k6 runs, doesn't abort with a configuration error or something like that... but it interprets the
5000
value forduration
as 5000 nanoseconds, i.e. 0.005 milliseconds, so it just immediately aborts... 🤦♂️ This is just a consequence of the way we've wrapped Go'stime.Duration
(which is nanosecond-based) in ourtypes.Duration
custom type (that parses things like"2s"
). Only, when it doesn't get a string, it falls back to the nanosecond code...So, I think we should unify and make everything saner... To do that with minimal breaking changes, I propose that we:
types.Duration
/types.NullDuration
?) everywhere we accept user-specified durationSo, the only breaking change is that users won't be able to specify the global options in nanoseconds, which won't be a big loss and I hope nobody has done...
The text was updated successfully, but these errors were encountered: