Skip to content

Commit

Permalink
tweak queries and use connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
sastels committed Feb 18, 2025
1 parent 7202a00 commit 0275c94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ fi
sleep 1200

# evaluate send rates
PGPASSWORD=$POSTGRES_PASSWORD psql -h "$POSTGRES_URL" -U "$POSTGRES_USER" -d "$POSTGRES_DATABASE_NAME" \
-f sql_queries/email_send_rate_query.sql > "$perf_test_results_folder/email_send_rate.txt"
psql "$DATABASE_READER_URI" -f sql_queries/email_send_rate_query.sql | grep -v row > "$perf_test_results_folder/email_send_rate.txt"

PGPASSWORD=$POSTGRES_PASSWORD psql -h "$POSTGRES_URL" -U "$POSTGRES_USER" -d "$POSTGRES_DATABASE_NAME" \
-f sql_queries/sms_send_rate_query.sql > "$perf_test_results_folder/sms_send_rate.txt"
psql "$DATABASE_READER_URI" -f sql_queries/sms_send_rate_query.sql | grep -v row > "$perf_test_results_folder/sms_send_rate.txt"

# Copy data to s3
aws s3 cp "$perf_test_csv_directory_path/" "s3://$perf_test_aws_s3_bucket" --recursive || exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ with data as (
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 sent_at >= CURRENT_DATE - INTERVAL '7 days'
and notification_type = 'email'
),
rollup as (
Expand All @@ -24,4 +23,5 @@ rollup as (
select day,
max(notifications_per_minute) as sustained_emails_per_minute
from rollup
group by day
group by day
order by day
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ with data as (
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 sent_at >= CURRENT_DATE - INTERVAL '7 days'
and notification_type = 'sms'
),
rollup as (
Expand Down

0 comments on commit 0275c94

Please sign in to comment.