Skip to content

Latest commit

 

History

History
90 lines (73 loc) · 2.14 KB

README.md

File metadata and controls

90 lines (73 loc) · 2.14 KB

Load Generator

This is a simple load generator that sends HTTP requests at specified intervals to a given URL. It supports concurrency and rate control to simulate different levels of traffic load.

Features

  • Sends GET requests to a specified URL
  • Controls request rate (requests per second)
  • Supports concurrent requests
  • Runs for a specified duration
  • Handles request failures gracefully

Requirements

  • Python 3.x
  • Go 1.x
  • Java 8+
  • C compiler (GCC or Clang)
  • Rust (Cargo)
  • requests package (for Python)
  • libcurl (for C implementation)

Installation

Python

Install the required dependencies using:

pip install requests

Go

Compile the Go version:

go build load_generator.go

Java

Compile the Java version:

javac LoadGenerator.java

C

Compile the C version:

gcc load_generator.c -o load_generator -lcurl -pthread

Rust

Build the Rust version:

cargo build --release

Usage

Run the script using the following command:

Python

python load_generator.py --url <TARGET_URL> --rate <REQUESTS_PER_SECOND> --duration <DURATION_IN_SECONDS> --concurrency <NUMBER_OF_CONCURRENT_REQUESTS>

Go

./load_generator --url <TARGET_URL> --rate <REQUESTS_PER_SECOND> --duration <DURATION_IN_SECONDS> --concurrency <NUMBER_OF_CONCURRENT_REQUESTS>

Java

java LoadGenerator <TARGET_URL> <REQUESTS_PER_SECOND> <DURATION_IN_SECONDS> <NUMBER_OF_CONCURRENT_REQUESTS>

C

./load_generator <TARGET_URL> <REQUESTS_PER_SECOND> <DURATION_IN_SECONDS> <NUMBER_OF_CONCURRENT_REQUESTS>

Rust

target/release/load_generator <TARGET_URL> <REQUESTS_PER_SECOND> <DURATION_IN_SECONDS> <NUMBER_OF_CONCURRENT_REQUESTS>

Parameters

  • --url: The target URL to send requests to (required)
  • --rate: Number of requests per second (default: 1)
  • --duration: Duration of the load test in seconds (default: 10)
  • --concurrency: Number of concurrent requests (default: 5)

License

This project is open-source and available under the MIT License.

Contributers

@PramithaMJ