mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 16:31:15 -05:00
Added stats annotation to a few more methods to track which methods need to be improved to increase billing performance
This commit is contained in:
@@ -26,6 +26,7 @@ def get_service_ids_that_need_billing_populated(start_date, end_date):
|
||||
).distinct().all()
|
||||
|
||||
|
||||
@statsd(namespace="dao")
|
||||
def create_or_update_monthly_billing(service_id, billing_month):
|
||||
start_date, end_date = get_month_start_and_end_date_in_utc(billing_month)
|
||||
_update_monthly_billing(service_id, start_date, end_date, SMS_TYPE)
|
||||
@@ -47,6 +48,7 @@ def _monthly_billing_data_to_json(billing_data):
|
||||
return results
|
||||
|
||||
|
||||
@statsd(namespace="dao")
|
||||
@transactional
|
||||
def _update_monthly_billing(service_id, start_date, end_date, notification_type):
|
||||
billing_data = get_billing_data_for_month(
|
||||
|
||||
@@ -105,6 +105,7 @@ def is_between(date, start_date, end_date):
|
||||
return start_date <= date <= end_date
|
||||
|
||||
|
||||
@statsd(namespace="dao")
|
||||
def billing_data_per_month_query(rate, service_id, start_date, end_date, notification_type):
|
||||
month = get_london_month_from_utc_column(NotificationHistory.created_at)
|
||||
if notification_type == SMS_TYPE:
|
||||
|
||||
Reference in New Issue
Block a user