[英]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.