locustio / locust

Write scalable load tests in plain Python 🚗💨
MIT License
24.64k stars 2.96k forks source link

all tests results suddenly turned to all 0 #662

Closed 08tjlys closed 6 years ago

08tjlys commented 6 years ago

hi,everyone i am new to locust and i found such thing which really confused me i use different usernames and passwords to log in the site,and i call my "log in" function under on_start funtion,but when i started my locust script, i found at first i can see everything worked well, all my usernames and passwords were used to log in and i could see all these requests detailed info like their "median","average",but suddenly i saw all these numbers turened to 0 like following pic, i found only all "log in" requests had such problem, all other requests showed correctly, so i wonder why that happened?thank u in advance

image

heyman commented 6 years ago

Could it be because the stats are reset once all Locust users has been spawned? In that case you can turn of the resetting of the stats with the --no-reset-stats flag.

08tjlys commented 6 years ago

hi,heyman,thanks a lot for ur idea,u r right,it worked now,thanks again. it looks like that it is default setting in locust that stats will be reset when all locust users are spawned so u have to add --no-reset-stats flag?sorry if i am wrong,but it will be better if i can see more such flag info on documentation.

heyman commented 6 years ago

Yeah, a page documenting all command line options wouln't hurt. Just a simple copy of the locust --help output would probably suffice.

hhowe29 commented 6 years ago

Seems like --no-reset-stats should default to being on, or removed in favor of a --reset-stats-on-hatch-complete.

We are gradually hatching about 1000 locusts that all need to authenticate with a login server. We hatch them slowly to avoid overwhelming the login server. After they login, they start performing our regular workflow. By default, we lose all those stats when the last locust is finally born.

Also, the behavior of --no-reset-stats in a master/slave config should be spelled out (ie, it needs to be set for both).