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

How to send two parameter from yaml to socket.io using artillery.io #348

Open
furqanms opened this issue Aug 30, 2017 · 3 comments · May be fixed by #711
Open

How to send two parameter from yaml to socket.io using artillery.io #348

furqanms opened this issue Aug 30, 2017 · 3 comments · May be fixed by #711

Comments

@furqanms
Copy link

furqanms commented Aug 30, 2017

I am new to yaml and artillery.io

I don't know how to send two parameter, in my case for "data" and "massage" from yaml emit to "send-room-message"

Socket.io

socket.on('send-room-message', function (data, message) {
socket.broadcast.to(data.room).emit('get-room-message', data, message);
});

socketio-chat-load-test.yaml

config:
    target: "http://localhost:3030"  
phases:
- duration: 5 
  arrivalRate: 100   
variables:
greeting: ["hello", "goedemorgen", "добрый день", "guten tag", "bonjour", "hola"]  
variables:
room:
  - 2
scenarios:
 - name: "A user that just talks"
weight: 75
engine: "socketio"
flow:
  - get:
      url: "/"     
  - emit:          
      channel: "add-user"
      data: {"id": "112312", "Name":'Hello'}
  - emit:
      channel: "join-room"
      data: "2"
  - emit :
      channel: "push-room-button"
      data: "2"
      response: 
        channel: "room-busy"
        data: "2"
  - emit:
      channel: "send-room-message"
      data: <<--TODO-->>

Please suggest

@hassy
Copy link
Member

hassy commented Aug 30, 2017

That's not supported yet @furqanms, but would be a good feature to support.

(I edited your post to add code formatting for the YAML block to make it easier to read.)

sshh12 added a commit to sshh12/artillery that referenced this issue Jun 12, 2019
Fixes artilleryio#348 by allowing users to specify the arguments to use with
`socket.emit()`.
@sshh12 sshh12 linked a pull request Jun 12, 2019 that will close this issue
sshh12 added a commit to sshh12/artillery that referenced this issue Jun 12, 2019
Fixes artilleryio#348 by allowing users to specify the arguments to use with
`socket.emit()`.
@kpachbiu88
Copy link

kpachbiu88 commented Jun 22, 2020

Please, update Documentation

URL: https://artillery.io/docs/socketio-reference/
Text: "...data - the data to emit (as a string). Note that multiple arguments for emit are not supported yet."
Update text: "data - the data to emit (as a string or object)"

@eliezercazares
Copy link

I need this too

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

Successfully merging a pull request may close this issue.

4 participants