Skip to content

A command-line tool for testing API performance by sending multiple requests and measuring key metrics such as response times and concurrency handling.

Notifications You must be signed in to change notification settings

Daufm/api-performance-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Performance Checker

A command-line tool for testing API performance by sending multiple requests and measuring key metrics such as response times and concurrency handling.

npm version downloads

Quick start

Install globally and run a quick test:

npm install -g api-performance-checker
apitest -u https://jsonplaceholder.typicode.com/posts -n 10 -c 2

Package on npm: https://www.npmjs.com/package/api-performance-checker

Installation from npm

npm install -g api-performance-checker

Usage

1. Command-Line Arguments

Run directly from the command line by specifying all options:

apitest -u <API_URL> -n <NUMBER_OF_REQUESTS> -c <CONCURRENCY_LEVEL> -t <TIMEOUT_MS> -m <METHOD> -H '{"Header":"Value"}' -o <OUTPUT_FILE>

Example:

apitest -u https://jsonplaceholder.typicode.com/posts -n 20 -c 5 -t 5000 -m GET -o results.json

2. Using a Config File

Create a config.json file with your options. This is useful for many or repeated arguments:

{
  "url": "https://jsonplaceholder.typicode.com/posts",
  "requests": 20,
  "concurrency": 5,
  "timeout": 5000,
  "method": "GET",
  "headers": {
    "Header": "Value"
  },
  "output": "results.json"
}

Run with:

apitest --config config.json

The path to the config file can be relative (e.g., ./config.json) or absolute (e.g., C:/Users/YourName/config.json).

Config File Options & Types

  • url (string, required): API URL to test
  • requests (integer, optional): Number of requests(default 10)
  • concurrency (integer, optional): Concurrent requests(default 5)
  • timeout (integer, optional): Request timeout in ms(default 5000)
  • method (string, optional): HTTP method (GET, default.)
  • headers (object, optional): Custom headers
  • output (string, optional): Output results(default results.json )

Output

If you specify the -o ,--output option or include output in your config file, results will be saved as a JSON file with all key metrics.

Notes

  • You can use either command line options or a config file.
  • The config file must be valid JSON.

About

A command-line tool for testing API performance by sending multiple requests and measuring key metrics such as response times and concurrency handling.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published