This project provides a simple API for simulating various performance scenarios, including CPU load, memory usage, and I/O operations. It's designed to help developers and QA engineers test the performance and resilience of their systems under different conditions.
- Simulate CPU-intensive operations
- Create controlled memory leaks
- Simulate file I/O operations
- Simulate network requests
- Introduce controlled delays in responses
-
Clone the repository:
git clone https://github.com/2bad/mire.git cd mire
-
Install dependencies:
npm install
-
Start the server:
npm run start
The server will start on http://localhost:3000
by default.
You can interact with the API using any HTTP client. Here are some example requests using curl
:
-
Check if the server is running:
curl http://localhost:3000/ping
-
Simulate a delayed response:
curl http://localhost:3000/delay/2000
-
Perform a CPU-intensive operation:
curl http://localhost:3000/cpu/compute/40
/ping
: Check if server is running/delay/:ms
: Delayed response/cpu/compute/:n
: Compute nth Fibonacci number/cpu/load
: Simulate random CPU usage/memory
: Get current memory usage/memory/leak
: Create a memory leak/memory/allocate
: Allocate memory/io/read
: Simulate file read operation/io/write
: Simulate file write operation/io/network
: Simulate network request
For more detailed information about the API endpoints, refer to the OpenAPI specification file: openapi.yml
.
The following environment variables can be used to configure the server:
PORT
: The port number on which the server will listen (default: 3000)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.