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

arrival-rate executors do not report active VUs accurately, they report initialized VUs instead #1977

Closed
Dieviete opened this issue Apr 19, 2021 · 4 comments · Fixed by #2953
Assignees
Labels
bug enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6

Comments

@Dieviete
Copy link

In the console output of K6 you can easily see how many VUs are currently active. See picture k6 console output

image

In the .json output there is a metric "vus" and a metric "vus_max". I would expect "vus" to reflect the number of currently active virtual users. However, in my .json output, except for the entries where "vus" is 0, "vus" and "vus_max" always have the same value. See picture k6 .json output

image

Is this a bug? If not, how to generate the correct number of active VUs in the .json output?

@na--
Copy link
Member

na-- commented Apr 19, 2021

Thanks for reporting this! We've known about for a while, but we lost sight of it... 😞 It is something halfway between a bug and a missing feature, one of the compromises for the sake of expedience to finally get #1007 out of the door last year... 😅 Its time to get fixed might have finally come, however, so I'll edit this issue a bit and keep it open. We probably should take care of it together with the rest of the items in #1386 and #1944

To give some details about the issue: currently, arrival-rate executors can easily show in the progress bars precisely how many active VUs they are using. However, since multiple scenarios can be executed simultaneously, and the vus metric is reported by k6 every second and encompasses all scenarios (though that might also change, see #1833), arrival-rate executors report as active all initialized VUs, even when that might not be the case.

@na-- na-- changed the title Why does the built-in metric “vus” in .json output not reflect the console output? arrival-rate executors do not report active VUs accurately, they report initialized VUs instead Apr 19, 2021
@Dieviete
Copy link
Author

Thank you for the quick response ☺️

@jsolv
Copy link

jsolv commented Apr 18, 2022

Hello!
How about status of this issue?
I can't get current actual VU's in metrics (from influxDB) in Grafana like values progress bar show, only values after slash. But i think it's good to write value before slash also.

@na-- na-- added this to the v0.39.0 milestone Apr 18, 2022
@na--
Copy link
Member

na-- commented Apr 18, 2022

Sorry @jsolv, nobody has worked on this yet. I added it to the next milestone, but I can't make any promises when we'll get to it... 😞 If someone wants to make a PR before we can, we can review it though!

@mstoykov mstoykov modified the milestones: v0.39.0, v0.40.0 Jun 15, 2022
@na-- na-- removed this from the v0.40.0 milestone Jun 29, 2022
@andrewslotin andrewslotin added the evaluation needed proposal needs to be validated or tested before fully implementing it in k6 label Feb 7, 2023
@imiric imiric self-assigned this Mar 2, 2023
imiric pushed a commit that referenced this issue Mar 3, 2023
This is a somewhat quick and dirty fix of #1977, where instead of
changing the global active VUs when the VU is activated, we change it
when the VU is actually running. This synchronizes it with the running
count of the internal activeVUPool, and reports the correct value
everywhere the ExecutionState is used (the real-time total active VU
count while the test is running, in all outputs, etc.).
@imiric imiric linked a pull request Mar 3, 2023 that will close this issue
imiric pushed a commit that referenced this issue Mar 3, 2023
This is a somewhat quick and dirty fix of #1977, where instead of
changing the global active VUs when the VU is activated, we change it
when the VU is actually running. This synchronizes it with the running
count of the internal activeVUPool, and reports the correct value
everywhere the ExecutionState is used (the real-time total active VU
count while the test is running, in all outputs, etc.).
imiric pushed a commit that referenced this issue Mar 8, 2023
* Fix active VU reporting by arrival-rate executors

This is a somewhat quick and dirty fix of #1977, where instead of
changing the global active VUs when the VU is activated, we change it
when the VU is actually running. This synchronizes it with the running
count of the internal activeVUPool, and reports the correct value
everywhere the ExecutionState is used (the real-time total active VU
count while the test is running, in all outputs, etc.).

* fixup! Fix active VU reporting by arrival-rate executors

* fixup! Fix active VU reporting by arrival-rate executors

* fixup! Fix active VU reporting by arrival-rate executors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants