You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
k6 inspect originally (and still) mostly just goes through the test and recalculates it's configuration. duration in this case is if you the user have set the duration confuration. Not the total duration.
Calculating the total duration is:
more involved
not actually accurate - as it is the maximum duration for some of the scenario executors
You can get the estimate by providing --execution-requirements to k6 inspect and looking at the totalDuration field.
Brief summary
On running K6 inspect test.js, Most of the values are null especially duration
{ "paused": null, "vus": null, "duration": null, "iterations": null, "stages": [ { "duration": "20s", "target": 1 }, { "duration": "20s", "target": 2 }, { "duration": "20s", "target": 1 } ], "scenarios": null, "executionSegment": null, "executionSegmentSequence": null, "noSetup": null, "setupTimeout": null, "noTeardown": null, "teardownTimeout": null, "rps": null, "dns": { "ttl": null, "select": null, "policy": null }, "maxRedirects": null, "userAgent": null, "batch": null, "batchPerHost": null, "httpDebug": null, "insecureSkipTLSVerify": null, "tlsCipherSuites": null, "tlsVersion": null, "tlsAuth": null, "throw": null, "thresholds": null, "blacklistIPs": null, "blockHostnames": null, "hosts": null, "noConnectionReuse": null, "noVUConnectionReuse": null, "minIterationDuration": null, "ext": null, "summaryTrendStats": null, "summaryTimeUnit": null, "systemTags": null, "tags": null, "metricSamplesBufferSize": null, "noCookiesReset": null, "discardResponseBodies": null }
I am using the following testscript
`import { check } from 'k6';
import http from 'k6/http';
export const options = {
"stages": [
{ "target": 1, "duration": "20s" },
{ "target": 2, "duration": "20s" },
{ "target": 1, "duration": "20s" }
]
}
export default function () {
const result = http.get('https://test-api.k6.io/public/crocodiles/');
check(result, {
'http response status code is 200': result.status === 200,
});
}
`
k6 version
0.49
OS
macOs 14.5
Docker version and image (if applicable)
No response
Steps to reproduce the problem
k6 inspect test.js
Expected behaviour
Returning duration of test
Actual behaviour
duration is null
The text was updated successfully, but these errors were encountered: