diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index 902126d6d..cdd34848c 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -76,6 +76,16 @@ def send_sms_to_provider(notification): delta_seconds = (datetime.utcnow() - notification.created_at).total_seconds() statsd_client.timing("sms.total-time", delta_seconds) + if notification.key_type == KEY_TYPE_TEST: + statsd_client.timing("sms.test-key.total-time", delta_seconds) + else: + statsd_client.timing("sms.live-key.total-time", delta_seconds) + + if service.id in current_app.config.get('HIGH_VOLUME_SERVICE'): + statsd_client.timing("sms.high-volume.total-time", delta_seconds) + else: + statsd_client.timing("sms.not-high-volume.total-time", delta_seconds) + def send_email_to_provider(notification): service = notification.service @@ -122,6 +132,16 @@ def send_email_to_provider(notification): delta_seconds = (datetime.utcnow() - notification.created_at).total_seconds() statsd_client.timing("email.total-time", delta_seconds) + if notification.key_type == KEY_TYPE_TEST: + statsd_client.timing("email.test-key.total-time", delta_seconds) + else: + statsd_client.timing("email.live-key.total-time", delta_seconds) + + if service.id in current_app.config.get('HIGH_VOLUME_SERVICE'): + statsd_client.timing("email.high-volume.total-time", delta_seconds) + else: + statsd_client.timing("email.not-high-volume.total-time", delta_seconds) + def update_notification_to_sending(notification, provider): notification.sent_at = datetime.utcnow()