locust icon indicating copy to clipboard operation
locust copied to clipboard

Rewrite main.py

Open max-rocket-internet opened this issue 3 years ago • 4 comments

If you're not super familiar with the project then main.py is very hard to read 🙂

There's so many conditions, places where the flow stops (or does not stop depending on more conditions), function definitions and logic is all mixed together.

I think it could be improved somewhat?

(I'm not volunteering 😅)

max-rocket-internet avatar May 02 '22 18:05 max-rocket-internet

Totally agree, but we need a volunteer :)

cyberw avatar May 02 '22 18:05 cyberw

Well it's good to have an issue at least to start with 🙏

max-rocket-internet avatar May 02 '22 19:05 max-rocket-internet

Thanks for maintaining Locust @cyberw. It's useful to my work so much that I would be delighted to help.

Often times when I need browse the main.py, I feel the same pain. What ideas do you have? @max-rocket-internet @cyberw

I would also like to improve stats.py file. I've created a issue here

anudeepsamaiya avatar Jun 17 '22 14:06 anudeepsamaiya

What ideas do you have? @max-rocket-internet

It's just a long series of conditions so I think perhaps split it into multiple files, parts or functions that correspond to each function? Like perhaps separation of each "mode", like:

  • Running as master
  • Running as worker
  • Headless
  • etc

Just an idea 🙂

max-rocket-internet avatar Jun 21 '22 08:06 max-rocket-internet

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Aug 21 '22 02:08 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself!

github-actions[bot] avatar Aug 31 '22 02:08 github-actions[bot]