【发布时间】:2020-07-22 01:29:40
【问题描述】:
有没有办法在locust中调用GRPC python客户端。
当我运行代码locust -f 1.py 时会生成输出。但统计数据不起作用。他们闲着。
用户蜂拥而至,但所有数据都处于空闲状态
【问题讨论】:
标签: python python-3.x grpc locust grpc-python
有没有办法在locust中调用GRPC python客户端。
当我运行代码locust -f 1.py 时会生成输出。但统计数据不起作用。他们闲着。
用户蜂拥而至,但所有数据都处于空闲状态
【问题讨论】:
标签: python python-3.x grpc locust grpc-python
当你建立自己的客户端时,你需要报告样本来蚱蜢自己(因为否则它怎么会知道你做了什么?)
https://docs.locust.io/en/stable/testing-other-systems.html
要报告示例,您需要执行以下操作(如果您从 TaskSet 调用它 - 如果您已经在 User 类中,请跳过 .user 部分):
self.user.environment.events.request_success.fire(request_type="grpc", name=name, response_time=total_time_calculated_by_you, response_length=your_response_length)
在 1.0 之前的 locust 中,您会执行以下操作:
from locust import events,
events.request_success.fire(request_type="grpc", name=name, response_time=total_time_calculated_by_you, response_length=your_response_length)
【讨论】: