【发布时间】:2018-02-08 01:19:23
【问题描述】:
相关:Testing Socket.io - Artillery.io Docs
我不知道如何发送两个参数,在我的例子中,“数据”和“按摩”从 yaml 发射到“发送房间消息”
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-->>
有什么想法吗?
【问题讨论】:
标签: node.js socket.io load-testing