我想在分发模式下使用mqtt-locust [https://github.com/ajm188/mqtt-locust],我使用以下命令来实现
在主控中:
locust -f locustfile.py --master --host=Host_IP:port
在奴隶中:
locust -f locustfile.py --slave --master-host=master_IP
运行这些命令后,从属设备显示启动蝗虫无误,而主设备显示
。
我该如何解决?
[2018-07-06 13:38:40,839] ip-172-31-23-29/INFO/locust.main: Starting web monitor at *:8089
[2018-07-06 13:38:40,842] ip-172-31-23-29/INFO/locust.main: Starting Locust 0.8
[2018-07-06 13:39:34,819] ip-172-31-23-29/INFO/locust.runners: Client u'ip-172-31-94-187_021a7b890749a9ce14df76a2a1970b0a' reported as ready. Currently 1 clients ready to swarm.
[2018-07-06 13:39:34,820] ip-172-31-23-29/ERROR/stderr: Traceback (most recent call last):
[2018-07-06 13:39:34,820] ip-172-31-23-29/ERROR/stderr: File "src/gevent/greenlet.py", line 716, in gevent._greenlet.Greenlet.run
[2018-07-06 13:39:34,820] ip-172-31-23-29/ERROR/stderr: File "/home/ubuntu/.local/lib/python2.7/site-packages/locust/runners.py", line 332, in client_listener
[2018-07-06 13:39:34,820] ip-172-31-23-29/ERROR/stderr: events.slave_report.fire(client_id=msg.node_id, data=msg.data)
[2018-07-06 13:39:34,820] ip-172-31-23-29/ERROR/stderr: File "/home/ubuntu/.local/lib/python2.7/site-packages/locust/events.py", line 27, in fire
[2018-07-06 13:39:34,821] ip-172-31-23-29/ERROR/stderr: handler(**kwargs)
[2018-07-06 13:39:34,821] ip-172-31-23-29/ERROR/stderr: File "/home/ubuntu/.local/lib/python2.7/site-packages/locust/stats.py", line 586, in on_slave_report
[2018-07-06 13:39:34,824] ip-172-31-23-29/ERROR/stderr: global_stats.total.extend(StatsEntry.unserialize(data["stats_total"]))
[2018-07-06 13:39:34,824] ip-172-31-23-29/ERROR/stderr: KeyError: 'stats_total'
[2018-07-06 13:39:34,824] ip-172-31-23-29/ERROR/stderr: 2018-07-06T13:39:34Z
[2018-07-06 13:39:34,824] ip-172-31-23-29/ERROR/stderr:
[2018-07-06 13:39:34,825] ip-172-31-23-29/ERROR/stderr: <Greenlet "Greenlet-0" at 0x7fb3cbdd2578: <bound method MasterLocus
这是pip freez的输出
certifi==2018.4.16
chardet==3.0.4
click==6.7
Flask==1.0.2
gevent==1.3.2.post0
greenlet==0.4.13
idna==2.6
itsdangerous==0.24
Jinja2==2.10
locust==0.8
MarkupSafe==1.0
msgpack-python==0.5.6
paho-mqtt==1.1
pyzmq==17.0.0
requests==2.18.4
six==1.11.0
urllib3==1.22
Werkzeug==0.14.1