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
{{ message }}
This repository was archived by the owner on Sep 28, 2022. It is now read-only.
Finally, push the code. Note that after you push this, the deployment pipeline will be triggered automatically
93
-
and therefore running the load tests scenarios in the Fargate cluster(s).
94
-
92
+
Finally, push the code. This will trigger the Code Pipeline which will run the tests in the Fargate cluster.
93
+
95
94
```bash
96
95
git push -u origin master
97
96
```
98
97
99
98
### 5. Monitor the test execution in CloudWatch
100
99
101
100
The CloudFormation template should have created a [CloudWatch Metric Filter](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html)
102
-
that will capture the average response time for each HTTP request that was issued to your system under test. You should
that will capture the average response time for each HTTP request that was issued to your system under test.
117
102
118
103
What this filter is doing, is parsing the Taurus logs that match that given format and assigning a variable name to each
119
104
value in the log. We are going to ignore all values in the log except for `avgRt` which is captured as a new metric and
@@ -127,34 +112,52 @@ The Dashboard will look something like this:
127
112
128
113
## Launch in Additional Regions (Optional)
129
114
130
-
It may be likely that running this solution from a single AWS region is enough to load test your application. However,
131
-
if you want to take it a step further, you can do so by deploying Fargate clusters in multiple regions and make this a
132
-
real distributed load test simulation. For this, I have created a separate CloudFormation template for you to launch the
133
-
solution in additional regions. The difference between this template and the Master one, is that this one doesn't
134
-
create the ECR Docker Registry and the IAM Execution Role, as you can share these resources across all Fargate deployments.
115
+
It may be likely that running this solution from a single AWS region is enough to load test your service. However,
116
+
if you want to take it a step further, you can deploy Fargate clusters in multiple regions and make it a
117
+
multi-region load test simulation. In order to do this, I created a separate CloudFormation template that launches this
118
+
solution in additional regions. The difference between this template and the Master one is that this one does not
119
+
create the ECR Docker Registry, the CodePipeline and IAM Roles, as those resources will be shared across all your regions.
135
120
136
-
Use the following buttons to launch the solution in the desired additional regions:
121
+
Use the following links to launch the solution in the desired additional regions:
137
122
138
123
Additional Region | Region Code | Launch
139
124
------|-----|-----
140
125
US East (N. Virginia) | us-east-1 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=DistributedLoadTesting&templateURL=https://s3.amazonaws.com/distributed-load-testing-using-aws-fargate/templates/additional-region.yaml)
141
126
US East (Ohio) | us-east-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=DistributedLoadTesting&templateURL=https://s3.amazonaws.com/distributed-load-testing-using-aws-fargate/templates/additional-region.yaml)
142
127
US West (Oregon) | us-west-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=DistributedLoadTesting&templateURL=https://s3.amazonaws.com/distributed-load-testing-using-aws-fargate/templates/additional-region.yaml)
143
-
144
128
145
-
## Run Locally
129
+
Once the stack creation has been completed, go back to the region where you launched the `Master` stack and follow these
130
+
steps:
131
+
132
+

133
+
134
+
1. Go to CodePipeline, then select the pipeline created by the master stack
135
+
2. Click on the `LoadTest` step to edit it.
136
+
3. Go to Edit > Environment
137
+
4. Expand the `Additional Configuration` section
138
+
5. Add 2 new environment variables to have your additional region added.
139
+
140
+
Name | Value
141
+
---------------------|---------------------
142
+
REGION_2 | Additional region (i.e. us-east-1)
143
+
REGION_2_STACK_NAME | CloudFormation stack name of the additional region (i.e. DistributedLoadTesting)
144
+
145
+
Save the changes and you are done! You can repeat those steps for every additional region.
146
+
147
+
## How to Run Locally
146
148
147
-
Build the image by issuing the following command in the root directory of this project.
149
+
It's a good practice to run your tests locally before pushing them to CodeCommit to make sure they run correctly in a
150
+
Docker container. To do this, build the image by issuing the following command in the root directory of this project.
148
151
149
152
```bash
150
153
docker build -t load-tests-using-fargate .
151
154
```
152
155
153
-
Then run the docker container locally.
156
+
Then run the container locally.
154
157
155
158
```bash
156
159
docker run -it load-tests-using-fargate taurus.yml
157
160
```
158
161
159
-
If the docker ran as expected, you can push the changes to your AWS CodeCommit repository and let the pipeline
162
+
If you are happy with the result, you can push the changes to the CodeCommit repository and let the pipeline
0 commit comments