Skip to content

samycici/artillery-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Performance Tests with Artillery

Performance tests' sample running a search at Google.

Set up

You'll need:

  • Node;

Install Dependencies:

npm install

Run Test

artillery run --config <config file to all tests>.yaml -e <env config. ex: staging> <./file_to/test>.yaml -o <json report>.json

Run with debug mode for the request

DEBUG=http artillery run --config <config file to all tests>.yaml -e <env config. ex: staging> <./file_to/test>.yaml -o <json report>.json

Run with debug mode looking for the response on the terminal

DEBUG=http:response artillery run --config <config file to all tests>.yaml -e <env config. ex: staging> <./file_to/test>.yaml -o <json report>.json

Send information to DataDog

This dependency is found in package.json, but if for some reason it doesn't install, you can try it this way:

npm install artillery-plugin-publish-metrics

or (for global instalation):

npm install -g artillery-plugin-publish-metrics

Then to run you need to export first the data-dog-api-key, and then run the tests

export DD_API_KEY=<data-dog-api-key>
artillery run --config <config file to all tests>.yaml -e <env config. ex: staging> <./file_to/test>.yaml

Generate report

artillery report <name of the json created on the run>.json

By scripts

A package.json was generated for this folder, targeting only the dependencies used for the test. For now there is only one example script configured. But basically the execution would be:

npm run test

Google RapidAPI-Key

To run these tests you'll need a X-RapidAPI-Key, it's just to go to Google API documentation and signup to get your X-RapidAPI-Key, after this you'll need to run:

export RAPID_API_KEY=<google-api-key>

Virtual Users management

Create 50 virtual users every second for 5 minutes:

phases:
    - duration: 300
      arrivalRate: 50

Constant arrival rate with no more than 50 concurrent VUs:

phases:
    - duration: 300
      arrivalRate: 10
      maxVusers: 50

Ramp up arrival rate from 10 to 50 over 2 minutes, followed by 10 minutes at 50 arrivals per second:

phases:
    - duration: 120
      arrivalRate: 10
      rampTo: 50
      name: "Warm up the application"
    - duration: 600
      arrivalRate: 50
      name: "Sustained max load"

Create 20 virtual users in 60 seconds (approximately one every 3 seconds):

phases:
    - duration: 60
      arrivalCount: 20

A pause:

phases:
    - pause: 60

For more info you can access Artillery Docs.

About

Performance tests' sample running a search at Google.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published