使用artilary进行socket io负载测试

时间:2018-04-03 11:18:54

标签: socket.io artillery

config:
  target: "http://192.168.2.161:5000"
  phases:
    - duration: 600
      arrivalRate: 5
scenarios:
  - name: "oz_event"
    flow:
      - loop:
          - emit:
              channel: "oz_event"
              data: "hello world!"
              namespace: "oz"
          - think: 1
        count: 50

这是我的艺术代码。当我运行此代码,然后显示必须指定一个网址

1 个答案:

答案 0 :(得分:1)

我已使用以下代码解决了此问题

config:
  target: "http://192.168.2.161:5000"
  phases:
    - duration: 600
      arrivalRate: 5
scenarios:
  - engine: "socketio"
    flow:
      - emit:
          channel: "oz_event"
          data: 'hello'
          namespace: "oz"
          response:
            channel: "oz_response"
            data: "hello"