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:
Richard Chapman
2017-09-22 12:22:40 +01:00
parent 4b99d6bb7a
commit a77c316d2f
2 changed files with 3 additions and 0 deletions

View File

@@ -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(

View File

@@ -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: