zeroae / zeroae/zae-limiter

✨ feat(loadtest): add `list-users` command and default locustfile directory

Open
#360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/cli performance
Dominant language
Python
Stars
0
Forks
0
Avg merge
6h 51m
Merged PRs (30d)
104

Description

Problem or Use Case

The loadtest run and loadtest tune commands currently require -f/--locustfile to be explicitly passed every time. Since all user classes live in examples/locust/locustfiles/, this should be the default. Additionally, there is no way to discover available Locust user classes without manually inspecting the directory.

These are the two remaining items from #346 (cascade user classes).

Proposed Solution

1. Default -f/--locustfile to the locustfiles directory

Make -f/--locustfile default to the examples/locust/locustfiles/ directory instead of being required. When a directory is passed, Locust auto-discovers all *User classes in all .py files within it.

# Before: required flag
zae-limiter loadtest run --name my-app -f examples/locust/locustfiles/simple.py

# After: defaults to locustfiles directory, discovers all user classes
zae-limiter loadtest run --name my-app
zae-limiter loadtest run --name my-app SimpleCascadeUser  # filter to specific class
2. Add loadtest list-users command

Wraps locust -f <dir> --list to show available user classes without starting a load test.

zae-limiter loadtest list-users

This aligns with Locust's native user class discovery mechanism.

Acceptance Criteria

  • -f/--locustfile defaults to the examples/locust/locustfiles/ directory in loadtest run and loadtest tune commands
  • loadtest list-users command exists and runs locust -f <locustfiles_dir> --list
  • loadtest list-users accepts optional -f/--locustfile override
  • Running zae-limiter loadtest list-users outputs available user classes (e.g., SimpleUser, SimpleCascadeUser, MaxRpsUser, MaxRpsCascadeUser)

Files

  • src/zae_limiter/loadtest/cli.py

Dependencies

Depends on #346 (cascade user classes already merged into the branch).

Parent: #340

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/zae_limiter/loadtest/cli.py and review how the existing loadtest run and tune commands invoke Locust. Add the default locustfiles directory and the list-users command with its optional -f/--locustfile override, then verify the acceptance-command output includes the listed user classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.