nikosmokas / automated-api-tester

An application for api and availability testing. Built with React, nodejs, MongoDB, AWS EC2, Terraform and deployed with Docker
https://api-tester.nmokas-dev.tech/
1 stars 0 forks source link

Load Testing Feature (REF ISSUE #11) #12

Open nikosmokas opened 3 weeks ago

nikosmokas commented 3 weeks ago

The feature will be broken down into microservices that will be used for other functionalities.

1. Queue Management Service

2. EC2 Management Service

3. Load Testing Execution Service

4. Result Aggregation Service

Revised Example Workflow in a Microservices Architecture with Spring Boot

  1. User Submits a Test:

    • The user submits a test through the frontend. The main API routes this request to the Queue Management Service.
  2. Queue Management:

    • The Queue Management Service adds the test job to the queue (using Redis or RabbitMQ) and signals the EC2 Management Service to provision instances.
  3. Provisioning:

    • The EC2 Management Service provisions EC2 instances using the AWS SDK for Java (or Terraform) and notifies the Load Testing Execution Service.
  4. Load Testing Execution:

    • The Load Testing Execution Service runs the load tests on the provided URL using Apache JMeter or Gatling and streams or sends results back to the Result Aggregation Service.
  5. Result Aggregation:

    • The Result Aggregation Service collects and processes the test results, making them available for querying.
  6. Tear Down:

    • After the test, the Queue Management Service checks if more tests are pending. If not, the EC2 Management Service is instructed to terminate the instances.
  7. User Receives Results:

    • The frontend polls or is notified by the main API when the results are ready, and the user can view the aggregated data.

Additional Enhancements with Spring Boot:

Spring Boot Configuration and Best Practices:

nikosmokas commented 1 week ago

Queue Management Service:

Build the jar file

./mvnw clean package

Build the Docker image

docker build -t queue-management-service .

Run the Docker container

docker run --name redis -p 6379:6379 -d redis docker run -p 8080:8080 --name queue-management-service --link redis:redis queue-management-service