Metadata-Version: 2.4
Name: http-benchmarker
Version: 0.1.2
Summary: Advanced HTTP load testing tool with real-time progress monitoring and detailed performance reports.
Author-email: Rasulzoda Muhammadmahdi <mrasulzoda@yandex.ru>
License: CC-BY-NC-4.0
Project-URL: Repository, https://github.com/mrasulzoda/http-benchmarker
Keywords: benchmark,http,cli,load-testing
Classifier: Programming Language :: Python :: 3
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: click>=8.1.0
Requires-Dist: numpy>=1.26.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: colorama>=0.4.0
Dynamic: license-file

# HTTP Benchmarker

[![License: CC BY-NC 4.0](https://img.shields.io/badge/License-CC_BY--NC_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc/4.0/)
[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Advanced HTTP load testing tool with real-time progress monitoring and detailed performance reports.

## Features

- ⚡ **Asynchronous requests** for high-concurrency testing  
- 📊 **Comprehensive metrics**: RPS, latency percentiles, success rate  
- 🚀 **Real-time progress** with TQDM integration  
- 📝 **Detailed error reporting** with error grouping  
- 💾 **Automatic report generation** (text/JSON)  
- 📈 **Statistical analysis**: p50, p90, p95, p99 latency  
- 🎨 **Color-coded terminal output**

---

## Installation

### From PyPI (recommended)

```bash
pip install http-benchmarker
```

### From source (development version)

```bash
git clone https://github.com/mrasulzoda/http-benchmarker.git
cd http-benchmarker
pip install -e .
```

## Basic Usage

Run HTTP benchmark tests from the command line using the http_benchmarker command.

### Default test (100 requests, 10 concurrency)

```bash
http_benchmarker bench https://api.example.com/get
```

### Advanced test with custom parameters

```bash
http_benchmarker bench https://api.example.com/data \
  --requests 500 \
  --concurrency 50 \
  --timeout 5
```

### POST request with JSON data from a file

```bash
http_benchmarker bench https://api.example.com/data \
  --method POST \
  --json-file data.json
```

### PUT request with JSON data from a file

```bash
http_benchmarker bench https://api.example.com/data \
  --method PUT \
  --json-file update.json \
  --requests 500 \
  --concurrency 50
```

### Save results to a report file

```bash
# Save as text report
http_benchmarker bench https://api.example.com --save-report

# Save as JSON report
http_benchmarker bench https://api.example.com --save-report --json-report
```

## Report Files

Reports are automatically saved with timestamped filenames:

- reports/http_benchmark_20250817_101533.txt

- reports/http_benchmark_20250817_101533.json

## Command Options

| Option             | Description                                    | Default     |
 |--------------------|-----------------------------------------------|-------------|
 | URL                | Target URL to test                            | Required    |
 | -r, --requests     | Total number of requests                      | 100         |
 | -c, --concurrency  | Concurrent connections                        | 10          |
 | -t, --timeout      | Request timeout (seconds)                     | 10          |
 | -m, --method       | HTTP method (GET,POST,PUT)                    | GET         |
 | --json-file        | Path to the JSON file with the request body   | None        |
 | --save-report      | Save results to file                          | False       |
 | --json-report      | Save in JSON format                           | False       |
 | --report-dir       | Reports directory                             | reports     |

 # 📜 License

This project uses the Creative Commons Attribution-NonCommercial 4.0 International license.

You can:

    ⬇️ Download and use the project

    📝 Study and modify the code

    ↔️ Distribute original and derivative works

Under the following conditions:

    👤 Attribution — You must give appropriate credit and link to the license

    🚫 NonCommercial — You may not use the material for commercial purposes



