Cannot understand how to use WebSocket Samplers on Jmeter
Hi, I am trying the samplers for a project and I do not understand how to do load testing of Socket.io and node.js using express.js. These are the details of my project: Link opened: http://127.0.0.1:3000/playtests/view/2b3a35bc-2204-41c7-8347-3ab98df4cecc websocket path defined in node: chatRoomsMessagesAppend: "chat/rooms/messages/append" data needed to be sent: Socket.emitMessage(Definitions.web.chatRoomsMessagesAppend, { "2b3a35bc-2204-41c7-8347-3ab98df4cecc", messageEntry: { text: "HI from Jmeter" } });
Could you please answer the following for me? 1. In server host what should be written? 2. In the port do I write 3000 or 80? 3. what path should be given? 4. how to send the above data in the text field? 5. So basically this is a chat box. When I run the code for 10 users, will 10 users send the message in the chat box? I mean will I see the messages in the chatbox of my website? Will my database save the same message 10 times?
Please get back to me as soon as possible because I need to do load testing of my application ASAP.
Comments (5)
-
repo owner -
repo owner - marked as trivial
-
repo owner - changed status to closed
-
reporter Hi Peter,
Thank you so much for helping me out. I really appreciate it.
Thanks.
-
repo owner 👍
- Log in to comment
Please read https://meta.stackoverflow.com/questions/326569/under-what-circumstances-may-i-add-urgent-or-other-similar-phrases-to-my-quest#326590 first. I'm doing all of this in my spare time. If you urgently need help, hire someone, and don't bother me with it.
Then, to answer your questions:
Socket.io is using websockets, but it is not the same as websockets. Socket.io puts their own protocol on top of websockets, and your test messages should adhere to that protocol. I can't help you with that, because i'm not a socket.io expert. However, i once created a sample test plan for a standard socket.io example that might help you; see the comments in https://bitbucket.org/pjtr/jmeter-websocket-samplers/issues/32/problem-with-writing-text-message-to-a. As explained there, the best way to find out what your test should send is starting a normal client and use WireShark to inspect the messages the client is sending to the server.
Hth.