-
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
teardown makes the max value of iteration_duration not correct #1836
Comments
Thanks for reporting this, though it's an already known issue, see #891, #1508, and #1321. The linked forum posts in grafana/k6-docs#205 offer a workaround, until we get around to actually writing the docs and properly fixing the issue... In short, However, until we have explicit tracking of sub-metrics, the only way to force k6 to track them is to set a threshold on one. This is what the workaround in grafana/k6-docs#205 describe. In your case, if you have this script: import { sleep } from 'k6'
import http from 'k6/http'
export let options = {
vus: 5,
duration: "10s",
thresholds: {
// We're using 'scenario:default' because that's the internal k6
// scenario name when we haven't actually specified `options.scenarios`
// explicitly and are just using the old execution shortcuts instead...
'iteration_duration{scenario:default}': [
// Some dummy threshold that's always going to pass. You don't even
// need to have something here, I tried it and just this
// `'http_req_duration{scenario:default}': []` is enough to trick
// k6, but that's undefined behavior I can't promise we won't break
// in the future...
`max>=0`,
],
// You can isolate setup and teardown metrics, if you are interested in them
// for some reason. This looks nasty, but '::' is the group separator...
'iteration_duration{group:::setup}': [`max>=0`],
'iteration_duration{group:::teardown}': [`max>=0`],
// And you can also isolate the HTTP metrics, in case of long-running requests
'http_req_duration{scenario:default}': [`max>=0`],
},
}
export function setup() {
http.get('http://httpbin.test.k6.io/delay/5');
}
export default function () {
http.get('http://test.k6.io/?where=default');
sleep(0.5);
}
export function teardown() {
http.get('http://httpbin.test.k6.io/delay/3');
sleep(5);
} You'd get a summary like this:
|
Environment
Expected Behavior
teardown should not affect the max value of the iteration_duration
Actual Behavior
the max value of the iteration_duration includes the running duration of the teardown
Steps to Reproduce the Problem
The max value of the iteration_duration should be 10s, not 2m.
The text was updated successfully, but these errors were encountered: