-
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
WebSocket session counter is not exactly same as VU #885
Comments
Thanks for creating this issue and the great description! I don't know what the reason for the low Some questions to help debug this and suggestions what to try:
Your current code should already do that 🙂 k6 works by having each active VU loop through the exported
This is the reason why I tagged the issue as
That last one is definitely a bug, and it's something I overlooked when I was refactoring the k6 metrics to be emitted in real-time in this pull request. All of the websocket metrics except |
Wow, thank you @na-- for the explanations, I will go thru them point by point and share with you the results. |
Hey there, first I really appricate k6 and thank you for this :)
I am trying to write some tests with websockets but for some reason k6 never opens the connection count that I want with -u.
If I give -u 10000 it usually opens 8k socket connections. If I give the -u 5000, it's somewhere around 4k. I am not sure if I am missing something here.
Here is the code version for the same .js file on the screen shot
As you can see I am also logging error and socket close events and since they are not showing up on the results I am assuming there was no error and no server side close issues. I also add active socket connection count to my backend and tracked that number real time and it's the same with the sessionCounter. So how come I can't open all the connections I want?
And from the documantation I was hoping to see default ws metrics to be on the result screen but for some reason I am not seeing, that is the reason I am counting every event manually.
And as an extra question, I also want to handle the socket connection errors to re-open that connection after an error to keep the session going. But I didn't see on the documantation page. I want to make my tests as real as possible and if a client loses its socket connection, it usually re-opens the connection.
Thank you.
The text was updated successfully, but these errors were encountered: