繁体   English   中英

如何在蝗虫中调用 GRPC python 客户端?

[英]How to invoke a GRPC python client in locust?

有没有办法在蝗虫中调用 GRPC python 客户端。

运行代码locust -f 1.py 但统计数据不起作用。 他们闲着。

用户蜂拥而至,但所有数据都处于空闲状态

当您建立自己的客户端时,您需要向自己报告样本(因为否则它怎么会知道您做了什么?)

https://docs.locust.io/en/stable/testing-other-systems.html

要报告示例,您需要执行以下操作(如果您从任务集中调用它 - 如果您已经在用户 class 中,请跳过 .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)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM