-
Notifications
You must be signed in to change notification settings - Fork 521
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
[Question] How to monitor messages arriving on socket.io channel? #170
Comments
You're right @gboysko, there's nothing like it in Artillery yet, but it's definitely something worth adding! What is your exact use case? One way to do it would be to define a hook (like the ones in the HTTP engine) - something like |
Yeah, that's pretty close to what I'm thinking. My use case is what you'd expect in many chat/collaboration services: new messages arrive as users interact and I'd like to ensure that the messages received are consistent with the scenario/flow. I'd love to be able to "fail" the flow if an unexpected message was received (or an expected message contained fields indicating a failure condition). I'm not sure how we would indicate that a flow remains in a "listening" state (other than re-purposing |
Cool, this is definitely a needed feature (not just for Socket.io either, but also for WebSockets and any other async protocol we want to support like MQTT or XMPP). As the first experiment we could go ahead with something like this:
scenarios:
- name: "A Socket.io scenario"
onMessage: "myOnMessageHandler"
flow:
- emit: "something" # flow definition here
scenarios:
- name: "A Socket.io scenario"
flow:
- emit: "something" # flow definition here
- listen: "myHandlerFunction"
- emit: "somethingElse" I can give it a go some time in the next few weeks, but it's up for grabs if someone wants to give it a go and open a PR before then. |
I'm new to Artillery and the code base, but may give it a try. I like the second option better as it reflects my own use case. If I did, I think it would be helpful to clearly understand the semantics. For example, I would suspect that the invoked handler function ( |
@gboysko yep, in the HTTP engine handler functions can do one of two things:
As to whether the |
@gboysko any luck? (if you've had the time) feel free to open a WIP PR, I'm happy to help out! |
For when we're implementing this feature - we now have the means to attach a handler to any incoming message in Socket.io now: artilleryio/artillery-core@ed21d66#diff-4c8bbeda468bf6bfdd048bd21ee2d037R248 |
@hassy hi! I am looking if you have tried to implement Listen/Receive Events feature on Artillery. This feature is something I need in my load testing where I am trying to Emit and Listen on like 50+ users. Any work around from your side would be really appreciated. Thanks!! |
@hassy I think issue here is pretty much what I was looking for in my discussion question. Any chance it's implemented in the new version of artillery? |
the capturing of a response is there for websockets, see #917 , but the pure listening e.g. directly after connection without a message beeing sent is still missing iiuc . |
don't know if this should be a different issue but having the websocket support for capturing/listening for responses without a message sent would be awesome. testing self hosted pusher like getting:
would upgrade the http to a ws connection and the initial message from the server contains a socket_id and such which needs to be captured and added to consequent ws requests. |
Hi! There is any info about implementation status of this feature? Is it planning? |
hey @hassy, any update of this feature? can we already listen for messages in a channel? |
Hi 👋 Any news on this feature ? I've seen this feature #917, but it allows to capture only after sending something. What if I want to send something, then wait for a particular message (the response to what I've sent) to arrive (among hundreds of others)? If this issue is already solved, let me know 😊 |
I need diz |
I need a way to listen and handle events arriving from the Socket.IO server without an emit event. |
I understand how flows can be written to emit socket.io messages and wait (for some indeterminate amount of time) for a response message, but how would we write flows that can receive arbitrary (real-time) messages sent from other virtual users?
I can envision some type of
monitor
function that receives messages for a given flow and can verify that they are correct. Perhaps this monitoring can occur during a "think" phase.I don't see anything in the documentation that addresses this type of real-time message validation. Is that consistent with the vision for Artillery?
The text was updated successfully, but these errors were encountered: