Skip to content

Commit 75cf541

Browse files
VIA-537 SB Add some CLI instructions to load test.
1 parent 1a5345c commit 75cf541

File tree

1 file changed

+17
-5
lines changed
  • infrastructure/environments/test/load-generator

1 file changed

+17
-5
lines changed

infrastructure/environments/test/load-generator/readme.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ For the following steps, you need to have deployed the infrastructure at least o
2424
Ensure you are [configured to access the test environment in AWS via the command line](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html). These instructions assume you've named your profile `vita-test`. All the info you need for that should be available via the [access portal](https://d-9c67018f89.awsapps.com/start/#/?tab=accounts).
2525

2626
```sh
27+
aws sso login --profile vita-test
28+
2729
load_generator_ecr_repository_url=$(aws ecr describe-repositories --profile vita-test | jq -r '.repositories[] | select(.repositoryName == "load-generator") | .repositoryUri')
2830

2931
aws ecr get-login-password --region eu-west-2 --profile vita-test | docker login --username AWS --password-stdin $(echo $load_generator_ecr_repository_url | cut -d/ -f1)
@@ -35,7 +37,13 @@ docker push "$load_generator_ecr_repository_url":latest
3537

3638
### Check it's working
3739

38-
Manually upload the [test plan](/performance/vita-user-journey.jmx) to the s3 path `s3://gh-vita-***-load-testing/plans/`. You should only need to do this if the test plan has been modified.
40+
Upload the [test plan](/performance/vita-user-journey.jmx) to the s3 path `s3://gh-vita-***-load-testing/plans/`. You should only need to do this if the test plan has been modified.
41+
42+
```shell
43+
aws sso login --profile vita-test
44+
45+
aws s3 cp performance/vita-user-journey.jmx s3://gh-vita-741448960880-load-testing/plans/ --profile vita-test
46+
```
3947

4048
#### Triggering the task
4149

@@ -77,6 +85,8 @@ Number of concurrent users = (Number of tasks) x (Number of threads/task)
7785
These instructions assume you've named your profile `vita-test`.
7886

7987
```shell
88+
aws sso login --profile vita-test
89+
8090
subnets=$(aws ec2 describe-subnets --filters "Name=tag:Name,Values=fake-api-project-public-subnet-1,fake-api-project-public-subnet-2,fake-api-project-private-subnet-1,fake-api-project-private-subnet-2" --profile vita-test | jq -r "[.Subnets[].SubnetId] | join(\",\")")
8191

8292
sec_group=$(aws ec2 describe-security-groups --filters "Name=tag:Name,Values=fake-api-service-sg" --profile vita-test | jq -r ".SecurityGroups[].GroupId")
@@ -98,16 +108,18 @@ aws ecs run-task \
98108
Download the test logs locally and generate a report using the following commands.
99109

100110
```shell
101-
# download the logs locally, replace yyyy/mm/dd with test date
102-
AWS_PROFILE=vita-test aws s3 sync s3://gh-vita-741448960880-load-testing/results/yyyy/mm/dd/ .
111+
aws sso login --profile vita-test
112+
113+
# Download the logs locally.
114+
aws s3 sync s3://gh-vita-741448960880-load-testing/results/$(date +%Y/%m/%d)/ . --profile vita-test
103115

104-
# take header from one of the logs and merge all logs into one file
116+
# Take header from one of the logs and merge all logs into one file
105117
head -n 1 $(ls *.jtl | head -n 1) > performance.logs
106118
for file in *.jtl; do
107119
tail -n +2 "$file" >> performance.logs
108120
done
109121

110-
# generate an HTML report
122+
# Generate an HTML report
111123
jmeter -g performance.logs -o report
112124
open report/index.html
113125
```

0 commit comments

Comments
 (0)