Coder Social home page Coder Social logo

j5ik2o / aws-gatling-tools Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 5.0 636 KB

the aws stress-test tool used by gatling

License: MIT License

Scala 58.51% Dockerfile 1.60% Makefile 4.86% Shell 3.69% HCL 31.34%
aws stress-test load-test gatling scala

aws-gatling-tools's Introduction

aws-gatling-tools

aws-gatling-tools is an AWS stress testing tool used by gatling to perform stress tests using processes on Fargate, output reports to S3, and notify chats of the URL of the report.

project structure

  • terraform
    • The terraform scripts for deploying a stress-test environment on AWS.
  • gatling-aggregate-runner
    • The application to manage stress testing.
  • gatling-runner
    • The application that performs stress tests.
  • gatling-s3-reporter(not sbt project)
    • The application that aggregates logs and outputs a report to S3.
  • api-server(for test)
    • The server application for testing.

preparation

  • installing tool
    $ brew install sbt awscli jq terraform
  • installing Docker for Mac
  • register an IAM user in AWS account
  • add a profile for the IAM user as aws-gatling-tools to ~/.aws/credentails.
    [aws-gatling-tools]
    aws_access_key_id = XXXXX
    aws_secret_access_key = XXXXX
    region = ap-northeast-1 

build the AWS environment

$ cd terraform
terraform $ cp terraform.tfvars.default terraform.tfvars
terrafrom $ vi terrafrom.tfvars # edit
terraform $ terraform init
terraform $ terraform plan
terraform $ terraform apply

If you don't need the test application(api-server), please comment out the following part of terraform/main.tf.

# module "ecr_api_server" {
#   source   = "./api-server"
#   prefix   = var.prefix
#   owner    = var.owner
#   vpc_id = module.vpc.vpc_id
#   subnet_ids = module.vpc.public_subnets
#   aws_subnet_public = var.aws_subnet_public
#   api_server_ecs_cluster_name = var.api_server_ecs_cluster_name
#   api_server_ecr_name = var.api_server_ecr_name
#   aws_account_id = var.account_id
# }

build the test application(if necessary)

This is just to check the operation.It is not necessary if you use your own test application.

# api-server docker build & push
$ AWS_DEFAULT_PROFILE=aws-gatling-tools sbt api-server/ecr:push

build the stress-test tools

# gatling-runner docker build & push
$ AWS_DEFAULT_PROFILE=aws-gatling-tools sbt gatling-runner/ecr:push

# gatling-s3-reporter docker build & push
$ cd gatling-s3-reporter && make release && cd ..

# gatling-aggregate-runner build & push
$ AWS_DEFAULT_PROFILE=aws-gatling-tools sbt gatling-aggregate-runner/ecr:push

run a stress-test

$ cp run-stress-test.sh.default run-stress-test.sh
$ vi run-stress-test.sh # edit stress-test conditions
$ sh ./run-stress-test.sh
  1. Aggregate Runner starts on the ECS cluster.
  2. Aggregate Runner starts the specified number of Runners, notifies to chat.
  3. Wait for all Runners until finish.
  4. After all runners have finished, launch the S3 Reporter, Aggregate Runner notifies to chat
  5. Aggregate Runner notifies the url to gatling report on S3.

All control is performed by Aggregate Runner, so the terminal can be closed after execute the command.

chat log example

Gatling Runner started:
task arns = [
https://ap-northeast-1.console.aws.amazon.com/ecs/home?region=ap-northeast-1#/clusters/j5ik2o-aws-gatling-tools-ecs/tasks/xxxxxxxxxx/details
...
https://ap-northeast-1.console.aws.amazon.com/ecs/home?region=ap-northeast-1#/clusters/j5ik2o-aws-gatling-tools-ecs/tasks/xxxxxxxxxx/details
]
runTaskCount = 10, runTaskEnvironments = Map(GATLING_S3_BUCKET_NAME -> j5ik2o-aws-gatling-tools-logs, GATLING_PAUSE_DURATION -> 3s, GATLING_TARGET_ENDPOINT_BASE_URL -> http://tf-xxxxxxxxxx-xxxxxxxx.ap-northeast-1.elb.amazonaws.com, GATLING_EXECUTION_ID -> api-server/xxxxxxxx-xxxxxxxxx, GATLING_SIMULATION_CLASS -> com.github.j5ik2o.gatling.BasicSimulation, GATLING_RAMP_DURATION -> 200s, GATLING_RESULT_DIR -> target/gatling, GATLING_HOLD_DURATION -> 5m, GATLING_USERS -> 10, AWS_REGION -> ap-northeast-1)
Gatling Runner finished: task arns = [
https://ap-northeast-1.console.aws.amazon.com/ecs/home?region=ap-northeast-1#/clusters/j5ik2o-aws-gatling-tools-ecs/tasks/xxxxxxxxxx/details
...
https://ap-northeast-1.console.aws.amazon.com/ecs/home?region=ap-northeast-1#/clusters/j5ik2o-aws-gatling-tools-ecs/tasks/xxxxxxxxxx/details
]
Gatling Reporter started: task arns = https://ap-northeast-1.console.aws.amazon.com/ecs/home?region=ap-northeast-1#/clusters/j5ik2o-aws-gatling-tools-ecs/tasks/xxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxxxx/details
runTaskReporterEnvironments = Map(AWS_REGION -> ap-northeast-1, GATLING_BUCKET_NAME -> j5ik2o-aws-gatling-tools-logs, GATLING_RESULT_DIR_PATH -> api-server/xxxxxxxxxxx-xxxxxxxxxxxx)
Gatling Reporter finished: report url: https://j5ik2o-aws-gatling-tools-logs.s3.amazonaws.com/api-server/xxxxxxxxx-xxxxxxxxxxx/index.html

gatling report example

aws-gatling-tools's People

Contributors

dependabot[bot] avatar j5ik2o avatar renovate-bot avatar shin1x1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aws-gatling-tools's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency com.mintbeans:sbt-ecr to v0.16.0
  • chore(deps): update dependency com.typesafe.sbt:sbt-native-packager to v1.8.1
  • chore(deps): update dependency io.gatling:gatling-sbt to v3.9.0
  • chore(deps): update dependency io.spray:sbt-revolver to v0.10.0
  • chore(deps): update dependency org.aspectj:aspectjweaver to v1.9.22.1
  • chore(deps): update dependency org.codehaus.janino:janino to v3.1.12
  • chore(deps): update dependency org.scalameta:sbt-scalafmt to v2.5.2
  • chore(deps): update dependency sbt/sbt to v1.10.1
  • chore(deps): update dependency scala to v2.13.14
  • chore(deps): update dependency scalafmt to v3.8.3
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update dependency net.logstash.logback:logstash-logback-encoder to v8
  • chore(deps): update dependency org.slf4j:jul-to-slf4j to v2
  • chore(deps): update dependency org.slf4j:slf4j-api to v2
  • chore(deps): update olafurpg/setup-scala action to v14
  • chore(deps): update openjdk docker tag to v17
  • chore(deps): update tibdex/github-app-token action to v2
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
gatling-runner/docker-compose.yml
gatling-s3-reporter/docker-compose.yml
dockerfile
gatling-s3-reporter/Dockerfile
  • openjdk 8-jdk-alpine
github-actions
.github/workflows/ci.yml
  • actions/checkout v3
  • olafurpg/setup-scala v13
  • coursier/cache-action v6
  • actions/checkout v3
  • olafurpg/setup-scala v13
  • coursier/cache-action v6
  • tibdex/github-app-token v1
  • pascalgn/automerge-action v0.15.5
.github/workflows/scala-steward.yml
  • tibdex/github-app-token v1
  • scala-steward-org/scala-steward-action v2.36.0
sbt
build.sbt
  • org.aspectj:aspectjweaver 1.8.13
  • org.mortbay.jetty.alpn:jetty-alpn-agent 2.0.9
  • com.typesafe.akka:akka-http 10.1.11
  • com.github.scopt:scopt 4.0.1
  • net.logstash.logback:logstash-logback-encoder 4.11
  • org.slf4j:jul-to-slf4j 1.7.26
  • ch.qos.logback:logback-classic 1.2.11
  • org.slf4j:slf4j-api 1.7.36
  • ch.qos.logback:logback-classic 1.2.11
  • org.codehaus.janino:janino 3.0.6
  • com.iheart:ficus 1.4.6
  • com.github.j5ik2o:reactive-aws-ecs-core 1.1.3
  • org.scalaj:scalaj-http 2.4.2
project/Settings.scala
  • scala 2.13.1
  • scala 2.12.13
project/build.properties
  • sbt/sbt 1.6.2
project/plugins.sbt
  • com.github.j5ik2o:reactive-aws-ecs-core 1.1.3
  • io.gatling:gatling-sbt 3.1.0
  • com.typesafe.sbt:sbt-native-packager 1.7.0
  • com.lightbend.sbt:sbt-javaagent 0.1.4
  • com.mintbeans:sbt-ecr 0.15.0
  • io.spray:sbt-revolver 0.9.1
  • org.scalameta:sbt-scalafmt 2.4.6
  • ch.epfl.scala:sbt-scalafix 0.9.30
scalafmt
.scalafmt.conf
  • scalafmt 3.5.2
terraform
terraform/main.tf
  • hashicorp/terraform >= 0.12

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.