node load testing-check
- Install Node.js:
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
- Create a new Node.js project:
mkdir load-testing-check
cd load-testing-check
npm init -y
- Install the required packages:
npm install -D artillery
- Create an Artillery configuration file (
artillery.config.yml
):
config:
target: 'http://your-api-endpoint.com'
phases:
- duration: 60
arrivalRate: 5
defaults:
headers:
User-Agent: 'load-testing-check'
scenarios:
- flow:
- get:
url: '/your-api-endpoint'
- Create a test script (e.g.,
test-script.yml
):
config:
target: 'http://your-api-endpoint.com'
phases:
- duration: 60
arrivalRate: 5
defaults:
headers:
User-Agent: 'load-testing-check'
scenarios:
- flow:
- get:
url: '/your-api-endpoint'
- Run the load test:
npx artillery run test-script.yml
Note: Replace 'http://your-api-endpoint.com' with the actual endpoint you want to test. Adjust the test configuration in the test-script.yml
file as needed.