Skip to content

chrispsheehan/performance-test-framework

Repository files navigation

PerformanceTestFramework

These example tests are currently pointed at the MockApp, which is hosted in Docker.

To target another URI remove the mock service and set the APP_DOMAIN environmental variable within the docker-compose file.

References:

Build code in docker

docker run -i --rm -v ${PWD}/:/app node:16.5-alpine npm run build --prefix /app

Run in docker-compose

  • The below command will;
    • Start a target mock api
    • Execute the tests via k6
docker-compose run --rm k6-runner && docker-compose stop

Tags

Tags are used to separate results from one another as documented here.

headers.tags = { tag: "getuser" };

Thresholds

Thresholds are set on a per tag basis as documented here.

  • p(95)<2000 95% of requests to run in 5 seconds or less.
  • rate<=0.01 99% of requests successful.
export let options = {
  
  thresholds: {
    "http_req_duration{tag:getuser}": ['p(95)<10000'],
    "http_req_failed{tag:getuser}": ['rate<=0.01'],

    "http_req_duration{tag:createuser}": ['p(95)<2000'],
    "http_req_failed{tag:createuser}": ['rate<=0.01'],    
  },
};

Gotchas

  • ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries
  • FIX: add platform: linux/x86_64 to docker-compose

Releases

No releases published

Packages

No packages published