ฉันใช้ตั๊กแตนเพื่อทดสอบความเครียดในแอปของเรา
ฉันได้รับข้อผิดพลาดเนื่องจากการเรียก POST ดูเหมือนไม่ถูกต้อง ฉันจะดูบันทึกของตั๊กแตนได้ที่ไหน ฉันต้องการดูว่าการโทรโพสต์มีลักษณะอย่างไรเพื่อดูว่ามีอะไรผิดปกติ
นี่คือรหัสของฉันในกรณีที่มีคนบอกฉันว่าฉันทำอะไรผิด:
from locust import HttpLocust, TaskSet, task
json3 = """{"stack_name": "beenz-php-app-12", "disable_rollback": true, "template": "php", "timeout_mins": 60}"""
class MyTaskSet(TaskSet):
@task
def send(self):
response = self.client.post("/stacks", json3, headers={'X-Auth-Key': 'xxxx', 'Content-Type': 'application/json', 'X-Auth-User': 'xxxx', 'Accept': 'application/json', 'X-Auth-Token':'xxxx'})
print "Response status code:", response.status_code
print "Response content:", response.content
class MyLocust(HttpLocust):
task_set = MyTaskSet
min_wait = 5000
max_wait = 15000
ขอบคุณ!