We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to use locust to login my server for 100 times.
Each user has a unique identification number which is represented by id in the code below.
id
from locust import HttpLocust, TaskSet, task class UserBehavior(TaskSet): @task(1) def login(self): WebsiteUser.id += 1 print("WebsiteUser.id: " + str(WebsiteUser.id)) self.client.post("/index.html", data={}) class WebsiteUser(HttpLocust): id = 0 task_set = UserBehavior min_wait=500 max_wait=500
The way I execute locustfile.py is
locustfile.py
locust --host=http://127.0.0.1 -c 100 -r 100 -n 100 --no-web --print-stats
I expected that in the end of the execution, I would see WebsiteUser.id: 100 being printed on my screen.
WebsiteUser.id: 100
But I saw WebsiteUser.id: 300. Why is this happening?
WebsiteUser.id: 300
The index.html under 127.0.0.1 is a simple file which contains
index.html
127.0.0.1
<html><body><h1>It works!</h1></body></html>.
<html><body><h1>It works!</h1></body></html>
Here's the final report of the execution:
The text was updated successfully, but these errors were encountered:
@lyenliang are you looking at the last request's response time? In your screenshot I see 100 requests being fired.
Sorry, something went wrong.
No branches or pull requests
I'm trying to use locust to login my server for 100 times.
Each user has a unique identification number which is represented by
id
in the code below.The way I execute
locustfile.py
islocust --host=http://127.0.0.1 -c 100 -r 100 -n 100 --no-web --print-stats
I expected that in the end of the execution, I would see
WebsiteUser.id: 100
being printed on my screen.But I saw
WebsiteUser.id: 300
. Why is this happening?The
index.html
under127.0.0.1
is a simple file which contains<html><body><h1>It works!</h1></body></html>
.Here's the final report of the execution:
The text was updated successfully, but these errors were encountered: