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

present setup() function breaks iteration_duration metric #3799

Closed
dvob opened this issue Jun 18, 2024 · 2 comments
Closed

present setup() function breaks iteration_duration metric #3799

dvob opened this issue Jun 18, 2024 · 2 comments
Assignees

Comments

@dvob
Copy link

dvob commented Jun 18, 2024

Brief summary

If a setup function is present the iteration_duration metrics are wrong.
It seems that the time used to run setup() is incorporated into the iteration_duration metric.

Maybe related to #2718

k6 version

v0.51.0

OS

Linux

Docker version and image (if applicable)

No response

Steps to reproduce the problem

  • script.js
import { sleep } from 'k6';

export function setup() {
}

export default function() {
  sleep(1);
}

Expected behaviour

iteration_duration metrics (avg, min, med, max, p(90), p(95)) are all 1s.

     data_received........: 0 B 0 B/s
     data_sent............: 0 B 0 B/s
     iteration_duration...: avg=1s min=1s med=1s max=1s p(90)=1s p(95)=1s
     iterations...........: 1   0.999474/s
     vus..................: 1   min=1      max=1
     vus_max..............: 1   min=1      max=1

Actual behaviour

iteration_duration min shows a very low value:

     data_received........: 0 B 0 B/s
     data_sent............: 0 B 0 B/s
     iteration_duration...: avg=500.52ms min=1.67µs med=500.52ms max=1s p(90)=900.94ms p(95)=950.99ms
     iterations...........: 1   0.998617/s
     vus..................: 1   min=1      max=1
     vus_max..............: 1   min=1      max=1

The time used to run setup() is incorporated into the iteration_duration metric.
If put a sleep(1) into the setup function the metric appears correct.

@codebien
Copy link
Contributor

Hey @dvob,
thanks for reporting it.

We are aware of it, you can check details in #3377 (comment) and #1605.

I'm going to close as it is a duplicate.

@codebien codebien closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
@codebien codebien removed the triage label Jun 18, 2024
@codebien codebien removed their assignment Jun 18, 2024
@dvob
Copy link
Author

dvob commented Jun 18, 2024

@codebien thank you for pointing me to the right issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants