Locust用路径参数将API视为不同的API
在Locust中,我产生了多个用户,这些用户以前缀/api/v1/bots/{bot_id}/
在端子上提出请求,其中bot_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?
目前,我使用一个单独的脚本来汇总数据,但它带有其自身的问题(不能汇总百分位数)
In locust, I spawn multiple users that make requests to endpoints with the prefix /api/v1/bots/{bot_id}/
where bot_id
is uniquely generate for each user. When locust generates a report, it treats each request with a different value for bot_id
as a separate API.
For example, the report shows the APIs
/api/v1/bots/00001/abc
/api/v1/bots/00002/abc
/api/v1/bots/00003/abc
/api/v1/bots/00004/abc
All of them are the same APIs with different parameters passed in the path. Is there a way to have locust treat them as the same API?
Currently, I am using a separate script to aggregate the data, but it comes with its own problem (cannot aggregate percentiles)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
name
参数,例如https://docs.locust.io/en/stable/writing-a-locustfile.html#grouping-requests
Use the
name
parameter, e.g.https://docs.locust.io/en/stable/writing-a-locustfile.html#grouping-requests