Skip to content
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

No data on k6 inspect #3890

Closed
ameetpal opened this issue Aug 7, 2024 · 1 comment
Closed

No data on k6 inspect #3890

ameetpal opened this issue Aug 7, 2024 · 1 comment
Assignees
Labels

Comments

@ameetpal
Copy link
Contributor

ameetpal commented Aug 7, 2024

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

@mstoykov
Copy link
Contributor

mstoykov commented Aug 7, 2024

Hi @ameetpal,

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:

  1. more involved
  2. 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.

Hope this helps you!

@mstoykov mstoykov closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants