locustfile.py 1004 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/python
  2. # -*- coding=utf-8 -*-
  3. # @Create Time: 2024-01-24 14:35:32
  4. # @Last Modified time: 2024-01-24 14:47:32
  5. from locust import HttpUser, task, between
  6. class MyHttpUser(HttpUser):
  7. wait_time = between(1, 2)
  8. @task
  9. def index_page(self):
  10. data = {
  11. "record_Time": "2024-01-17T05:14:53.632Z",
  12. "current_Url": "http://10.10.21.28/gmp/static/gmpweb/workbench/menu/AppNavExpand.html?appCode=eqpitassets&tSession=1703234778559",
  13. "full_Url": "http://domain/path",
  14. "user_Id": "zhangchijun@mz.gd.csg.cn",
  15. "device_Id": "string",
  16. "request_Method": "GET",
  17. "event_Type": "click",
  18. "form_Data": "{}",
  19. "value_Data": "string",
  20. "status_Code": 200,
  21. "target_Url": "http://10.10.21.28/api/jadp/workbench/todos/todoCountByUserId?_=1703234767322",
  22. "button_Text": "申领管理"
  23. }
  24. self.client.post("http://localhost:7788/record", json=data)