Locust: Typo in generating-custom-load-shape.rst

Created on 4 Sep 2020  路  5Comments  路  Source: locustio/locust

Describe the bug

Small typo in Description of example in generating-custom-load-shape.rst. Spawn rate in description and code are different. Example mentions:

This shape class will increase user count in blocks of 100 and then stop the load test after 10 minutes

Expected behavior

Code to contain:
spawn_rate = 100

Actual behavior

spawn_rate = 20

bug invalid

All 5 comments

It's not a typo, the spawn_rate here is not related to increase user count in blocks of 100 馃檪

It's this part: user_count = round(run_time, -2)

The -2 here rounds to the nearest 100 and that is what is blocks of 100 is about. Example:

>>> for i in [10, 40, 60, 140, 160, 220, 280]:
...     print(round(i, -2))
...
0
0
100
100
200
200
300

Make sense?

I remember being confused by the same thing and having to look up round() to see what it did :)

Maybe we could clarify it a little by adding a comment on that line?

Maybe we could clarify it a little by adding a comment on that line?

Sure thing. PRs welcome 馃槅

Fixed!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radiantone picture radiantone  路  3Comments

YannickXiong picture YannickXiong  路  3Comments

dolohow picture dolohow  路  3Comments

ghost picture ghost  路  3Comments

ludo550 picture ludo550  路  3Comments