Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Ankit

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
59 changes: 51 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,73 @@ Compare performance results between two Locust runs and show changes relative to

- Python 3.8+ (no third-party dependencies).

## Quick Start
## Installation

- Compare two run directories (each containing a `report.csv` and HTML files):
### With uvx (recommended)

Run directly from GitHub without cloning:

```bash
uvx --from git+https://github.com/dev-ankit/locust-compare.git locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
```

Or from a local directory:

```bash
uvx --from . locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
```

Or from a cloned repository:

```bash
git clone https://github.com/dev-ankit/locust-compare.git
cd locust-compare
uvx --from . locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
```

Once published to PyPI, you can run without any prefix:

```bash
uvx locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
```

### With pip

```bash
pip install .
locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
```

### Direct execution

```bash
python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294
```

- Compare two specific CSV files:
## Quick Start

- Compare two run directories (each containing a `report.csv` and HTML files):

```bash
locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
```
python3 compare_runs.py test_runs/HTML-Report-292/report.csv test_runs/HTML-Report-294/report.csv

- Compare two specific CSV files:

```bash
locust-compare test_runs/HTML-Report-292/report.csv test_runs/HTML-Report-294/report.csv
```

- JSON output for scripting:

```
python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294 --json
```bash
locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 --json
```

- Colorize output and show verdicts (green=better, red=worse):

```
python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294 --color
```bash
locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 --color
```

Exit code is `0` on success and `1` on error.
Expand Down
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "locust-compare"
version = "0.1.0"
description = "Compare Locust performance metrics between runs"
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
authors = [
{name = "Ankit", email = "dev@ankit.dev"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

[project.scripts]
locust-compare = "compare_runs:main"

[project.optional-dependencies]
dev = [
Expand All @@ -25,3 +48,6 @@ exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
]

[tool.hatch.build.targets.wheel]
only-include = ["compare_runs.py"]