/api/v1/bots/{bot_id}/在 locust 中,我生成了多個用戶,這些用戶使用前綴wherebot_id為每個用戶唯一生成的端點發出請求。當 locust 生成報告時,它會將具有不同值的每個請求bot_id視為單獨的 API。
例如,報告顯示 API
/api/v1/bots/00001/abc
/api/v1/bots/00002/abc
/api/v1/bots/00003/abc
/api/v1/bots/00004/abc
它們都是相同的 API,在路徑中傳遞的引數不同。有沒有辦法讓蝗蟲把它們當作同一個 API?
目前,我正在使用單獨的腳本來聚合資料,但它有自己的問題(不能聚合百分位數)
uj5u.com熱心網友回復:
使用name引數,例如
self.client.get(f"/api/v1/bots/{id}/abc", name="/api/v1/bots/<id>/abc")
https://docs.locust.io/en/stable/writing-a-locustfile.html#grouping-requests
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/497579.html
