Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Using Serverless-Artillery 40 requests with cache /users/{userId} #359

Open
VitaRox opened this issue Mar 23, 2021 · 0 comments
Open
Assignees
Labels
task New task, feature or request team1 Issues for Practicum Team 1
Milestone

Comments

@VitaRox
Copy link
Contributor

VitaRox commented Mar 23, 2021

Using Serverless-Artillery to test a deployed API endpoint

Installation Guide and Procedure

  1. Install aws-cli: (https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)
  2. Install serverless: npm i -g serverless (global) or npm i serverless --save-dev (project-level)
  3. Install artillery: npm i -g artillery (global) or npm i artillery --save-dev (project-level)
  4. Install serverless-artillery: npm i -g serverless-artillery (global) or npm i serverless-artillery --save-dev (project-level)
  5. From command line, navigate to root of project with cd
  6. 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.
  7. 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.
  8. 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}
  9. 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.
  10. Tear down deployed test assets (i.e. the AWS Lambda): slsart remove --stage {nameOfStage} --region {nameOfDeploymentRegion}
@VitaRox VitaRox added task New task, feature or request team1 Issues for Practicum Team 1 labels Mar 23, 2021
@VitaRox VitaRox added this to the Sprint 06 milestone Mar 23, 2021
@VitaRox VitaRox self-assigned this Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task New task, feature or request team1 Issues for Practicum Team 1
Projects
None yet
Development

No branches or pull requests

1 participant