【发布时间】:2014-09-25 22:35:42
【问题描述】:
我正在使用 locust 对我们的应用进行压力测试。
我收到错误,因为 POST 调用似乎不正确。我在哪里可以看到蝗虫的日志?我想看看 post call 的样子,看看有什么问题。
这是我的代码,以防有人能告诉我我做错了什么:
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
谢谢!
【问题讨论】:
-
我在 Locust 中看到了这个错误:HTTPError('500 Server Error: Server Error',)