-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests_nightly_performance/sql_queries/email_send_rate_query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* This query is used to calculate the maximum sustained email send rate per minute. | ||
* Here "sustained" means the average sent per minute over five minutes. | ||
*/ | ||
with data as ( | ||
select id, | ||
sent_at, | ||
sent_at::date as day, | ||
round_minutes(sent_at, 5) as sent_minute | ||
from notifications | ||
where sent_at is not null | ||
and sent_at >= NOW() - INTERVAL '3 hours' | ||
and sent_at >= CURRENT_DATE | ||
and notification_type = 'email' | ||
), | ||
rollup as ( | ||
select day, | ||
sent_minute, | ||
count(*) / 5 as notifications_per_minute | ||
from data | ||
group by day, | ||
sent_minute | ||
) | ||
select day, | ||
max(notifications_per_minute) as sustained_emails_per_minute | ||
from rollup | ||
group by day |
27 changes: 27 additions & 0 deletions
27
tests_nightly_performance/sql_queries/sms_send_rate_query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* This query is used to calculate the maximum sustained SMS send rate per minute. | ||
* Here "sustained" means the average sent per minute over five minutes. | ||
*/ | ||
with data as ( | ||
select id, | ||
sent_at, | ||
sent_at::date as day, | ||
round_minutes(sent_at, 5) as sent_minute | ||
from notifications | ||
where sent_at is not null | ||
and sent_at >= NOW() - INTERVAL '3 hours' | ||
and sent_at >= CURRENT_DATE | ||
and notification_type = 'sms' | ||
), | ||
rollup as ( | ||
select day, | ||
sent_minute, | ||
count(*) / 5 as notifications_per_minute | ||
from data | ||
group by day, | ||
sent_minute | ||
) | ||
select day, | ||
max(notifications_per_minute) as sustained_sms_per_minute | ||
from rollup | ||
group by day |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.