This commit is contained in:
Kenneth Kehl
2023-08-29 14:54:30 -07:00
parent 19dcd7a48b
commit 1ecb747c6d
588 changed files with 34100 additions and 23589 deletions

View File

@@ -17,25 +17,29 @@ def send_processing_time_to_performance_platform(local_date):
def send_processing_time_for_start_and_end(start_time, end_time, local_date):
result = dao_get_total_notifications_sent_per_day_for_performance_platform(start_time, end_time)
result = dao_get_total_notifications_sent_per_day_for_performance_platform(
start_time, end_time
)
current_app.logger.info(
'Sending processing-time to performance platform for date {}. Total: {}, under 10 secs {}'.format(
"Sending processing-time to performance platform for date {}. Total: {}, under 10 secs {}".format(
start_time, result.messages_total, result.messages_within_10_secs
)
)
send_processing_time_data(start_time, 'messages-total', result.messages_total)
send_processing_time_data(start_time, 'messages-within-10-secs', result.messages_within_10_secs)
send_processing_time_data(start_time, "messages-total", result.messages_total)
send_processing_time_data(
start_time, "messages-within-10-secs", result.messages_within_10_secs
)
def send_processing_time_data(start_time, status, count):
payload = performance_platform_client.format_payload(
dataset='processing-time',
dataset="processing-time",
start_time=start_time,
group_name='status',
group_name="status",
group_value=status,
count=count
count=count,
)
performance_platform_client.send_stats_to_performance_platform(payload)

View File

@@ -7,11 +7,11 @@ from app.dao.fact_notification_status_dao import (
# TODO: is this obsolete? it doesn't seem to be used anywhere
def send_total_notifications_sent_for_day_stats(start_time, notification_type, count):
payload = performance_platform_client.format_payload(
dataset='notifications',
dataset="notifications",
start_time=start_time,
group_name='channel',
group_name="channel",
group_value=notification_type,
count=count
count=count,
)
performance_platform_client.send_stats_to_performance_platform(payload)
@@ -19,8 +19,8 @@ def send_total_notifications_sent_for_day_stats(start_time, notification_type, c
# TODO: is this obsolete? it doesn't seem to be used anywhere
def get_total_sent_notifications_for_day(day):
email_count = get_total_sent_notifications_for_day_and_type(day, 'email')
sms_count = get_total_sent_notifications_for_day_and_type(day, 'sms')
email_count = get_total_sent_notifications_for_day_and_type(day, "email")
sms_count = get_total_sent_notifications_for_day_and_type(day, "sms")
return {
"email": email_count,