MCPcopy Create free account
hub / github.com/Tong89/smartNode / submit_fixed_request

Method submit_fixed_request

tests/load/locustfile.py:80–92  ·  view source on GitHub ↗

高权重:提交固定类型(TASK_CMD/高优先级)的请求。

(self)

Source from the content-addressed store, hash-verified

78
79 @task(5)
80 def submit_fixed_request(self):
81 """高权重:提交固定类型(TASK_CMD/高优先级)的请求。"""
82 payload = _fixed_payload()
83 with self.client.post(
84 "/api/request",
85 json=payload,
86 catch_response=True,
87 name="/api/request[fixed]",
88 ) as resp:
89 if resp.status_code not in (200, 400, 429):
90 resp.failure(f"Unexpected status: {resp.status_code}")
91 else:
92 resp.success()
93
94 @task(3)
95 def submit_random_request(self):

Callers

nothing calls this directly

Calls 2

_fixed_payloadFunction · 0.85
postMethod · 0.80

Tested by

no test coverage detected