You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install serverless: npm i -g serverless (global) or npm i serverless --save-dev (project-level)
Install artillery: npm i -g artillery (global) or npm i artillery --save-dev (project-level)
Install serverless-artillery: npm i -g serverless-artillery (global) or npm i serverless-artillery --save-dev (project-level)
From command line, navigate to root of project with cd
Create script: slsart script -e {URL of endpoint to hit with requests} -d 10 -r 40; this will hit the URL of the function you wish you test for 10 seconds, with a rate of 40 requests per second.
Configure AWS-CLI: aws configure; at the prompt, enter the AWS Access Key stored wherever your project keeps its Secrets/Keys; enter the AWS Access Secret (same place as the previous attribute); enter the AWS region which the project is deployed from. The config file should be findable at ~./aws/credentials.
Create a "stage": this will provision an AWS LoadGenerator Lambda function which will be used by serverless-artillery to generate load simulation for test. slsart deploy --stage {nameOfStage} --region {regionCodeOfDeployment, e.g. us-west-1}
Run script: slsart invoke -o {name of YML script generated by Step 6} | tee {nameOfTestResultsFile.json}; this should pipe the output both to the testResults.json file as well as to stdout.
Tear down deployed test assets (i.e. the AWS Lambda): slsart remove --stage {nameOfStage} --region {nameOfDeploymentRegion}
The text was updated successfully, but these errors were encountered:
Using Serverless-Artillery to test a deployed API endpoint
Installation Guide and Procedure
cd
slsart script -e {URL of endpoint to hit with requests} -d 10 -r 40
; this will hit the URL of the function you wish you test for 10 seconds, with a rate of 40 requests per second.aws configure
; at the prompt, enter the AWS Access Key stored wherever your project keeps its Secrets/Keys; enter the AWS Access Secret (same place as the previous attribute); enter the AWS region which the project is deployed from. The config file should be findable at~./aws/credentials
.slsart deploy --stage {nameOfStage} --region {regionCodeOfDeployment, e.g. us-west-1}
slsart invoke -o {name of YML script generated by Step 6} | tee {nameOfTestResultsFile.json}
; this should pipe the output both to the testResults.json file as well as to stdout.slsart remove --stage {nameOfStage} --region {nameOfDeploymentRegion}
The text was updated successfully, but these errors were encountered: