Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
sastels committed Apr 5, 2024
1 parent ab9ef8c commit ec05b04
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/execute_and_publish_performance_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mkdir -p $perf_test_csv_directory_path/$current_time
locust --headless --config tests-perf/locust/locust.conf --html $perf_test_csv_directory_path/$current_time/index.html --csv $perf_test_csv_directory_path/$current_time/perf_test
aws s3 cp $perf_test_csv_directory_path/ "s3://$perf_test_aws_s3_bucket" --recursive || exit 1

# Sleep 15 minutes to allow system to stabilize
# Sleep 15 minutes to allow the system to stabilize
sleep 600

# Run email send_rate performance test
Expand Down
4 changes: 2 additions & 2 deletions tests-perf/locust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ You can also modify the *locust.config* file to enable the headless mode and def

We also max out the email send rate by sending 2000 x 5 emails per minute for 10 minutes. This can be run manually with the command
```
locust --headless --host https://api.staging.notification.cdssandbox.xyz --locustfile tests-perf/locust/send_rate_email.py --users 5 --run-time 1m --spawn-rate 1
locust --headless --host https://api.staging.notification.cdssandbox.xyz --locustfile tests-perf/locust/send_rate_email.py --users 5 --run-time 10m --spawn-rate 1
```

### Performance Testing on AWS
Expand Down Expand Up @@ -104,4 +104,4 @@ ECS task. In order to do so, perform the following steps:
6. Once the task is ran, you can select it from the list of running tasks.
1. To see the logs of the running task and once you are in the task page, expand the container section. There should be a link to *View logs in CloudWatch* under the *Log Configuration* section.
7. On performance test completion, [the results should be in the `notify-performance-test-results-staging` S3 bucket](https://s3.console.aws.amazon.com/s3/buckets/notify-performance-test-results-staging?region=ca-central-1&tab=objects). Look into the folder that represents the proper timestamp for the test execution and open the `index.html` file located within.
8. The performance tests results should also be published [in this GitHub repository](https://github.com/cds-snc/notification-performance-test-results) every day at midnight. If you just executed the test, it will take some delay to have the tests published.
8. The performance tests results should also be published [in this GitHub repository](https://github.com/cds-snc/notification-performance-test-results) every day at midnight. If you just executed the test, it will take some delay to have the tests published.
8 changes: 6 additions & 2 deletions tests-perf/locust/send_rate_email.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" locust-notifications.py
""" send_rate_email.py
isort:skip_file
"""
# flake8: noqa
Expand Down Expand Up @@ -47,8 +47,12 @@ def __init__(self, *args, **kwargs):

@task(1)
def send_bulk_email_notifications(self):
"""
Send BULK_EMAIL_SIZE emails through the /bulk endpoint
"""

json = {
"name": f"My bulk name {datetime.utcnow().isoformat()}",
"name": f"My bulk name {datetime.now(datetime.UTC).isoformat()}",
"template_id": self.template_group.bulk_email_id,
"csv": rows_to_csv([["email address", "application_file"], *job_line(self.email, BULK_EMAIL_SIZE)])
}
Expand Down

0 comments on commit ec05b04

Please sign in to comment.