From f8e30f80b8b1c06935fef75be94ee2411f9ec3ff Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 2 Jan 2025 09:29:30 -0800 Subject: [PATCH 1/2] add performance testing debug info --- app/dao/notifications_dao.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index b9c3118fa..68c1268e3 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -1,5 +1,6 @@ import json from datetime import timedelta +from time import time from flask import current_app from sqlalchemy import ( @@ -727,6 +728,7 @@ def get_service_ids_with_notifications_on_date(notification_type, date): def dao_update_delivery_receipts(receipts, delivered): + start_time_millis = time() * 1000 new_receipts = [] for r in receipts: if isinstance(r, str): @@ -773,3 +775,7 @@ def dao_update_delivery_receipts(receipts, delivered): ) db.session.execute(stmt) db.session.commit() + elapsed_time = (time() * 1000) - start_time_millis + current_app.logger.info( + f"#loadtestperformance batch update query time: {elapsed_time} ms" + ) From e2d64c073872176049f455a1d1ec635e50f2c365 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 2 Jan 2025 11:07:20 -0800 Subject: [PATCH 2/2] add number of notifications processed --- app/dao/notifications_dao.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index 68c1268e3..139f7ae8a 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -777,5 +777,6 @@ def dao_update_delivery_receipts(receipts, delivered): db.session.commit() elapsed_time = (time() * 1000) - start_time_millis current_app.logger.info( - f"#loadtestperformance batch update query time: {elapsed_time} ms" + f"#loadtestperformance batch update query time: \ + updated {len(receipts)} notification in {elapsed_time} ms" )