mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Merge pull request #3047 from alphagov/sending-times-broken-down
Tweak sending time metrics to only include live notifications
This commit is contained in:
@@ -80,11 +80,10 @@ def send_sms_to_provider(notification):
|
|||||||
statsd_client.timing("sms.test-key.total-time", delta_seconds)
|
statsd_client.timing("sms.test-key.total-time", delta_seconds)
|
||||||
else:
|
else:
|
||||||
statsd_client.timing("sms.live-key.total-time", delta_seconds)
|
statsd_client.timing("sms.live-key.total-time", delta_seconds)
|
||||||
|
if service.id in current_app.config.get('HIGH_VOLUME_SERVICE'):
|
||||||
if service.id in current_app.config.get('HIGH_VOLUME_SERVICE'):
|
statsd_client.timing("sms.live-key.high-volume.total-time", delta_seconds)
|
||||||
statsd_client.timing("sms.high-volume.total-time", delta_seconds)
|
else:
|
||||||
else:
|
statsd_client.timing("sms.live-key.not-high-volume.total-time", delta_seconds)
|
||||||
statsd_client.timing("sms.not-high-volume.total-time", delta_seconds)
|
|
||||||
|
|
||||||
|
|
||||||
def send_email_to_provider(notification):
|
def send_email_to_provider(notification):
|
||||||
@@ -130,17 +129,15 @@ def send_email_to_provider(notification):
|
|||||||
update_notification_to_sending(notification, provider)
|
update_notification_to_sending(notification, provider)
|
||||||
|
|
||||||
delta_seconds = (datetime.utcnow() - notification.created_at).total_seconds()
|
delta_seconds = (datetime.utcnow() - notification.created_at).total_seconds()
|
||||||
statsd_client.timing("email.total-time", delta_seconds)
|
|
||||||
|
|
||||||
if notification.key_type == KEY_TYPE_TEST:
|
if notification.key_type == KEY_TYPE_TEST:
|
||||||
statsd_client.timing("email.test-key.total-time", delta_seconds)
|
statsd_client.timing("email.test-key.total-time", delta_seconds)
|
||||||
else:
|
else:
|
||||||
statsd_client.timing("email.live-key.total-time", delta_seconds)
|
statsd_client.timing("email.live-key.total-time", delta_seconds)
|
||||||
|
if service.id in current_app.config.get('HIGH_VOLUME_SERVICE'):
|
||||||
if service.id in current_app.config.get('HIGH_VOLUME_SERVICE'):
|
statsd_client.timing("email.live-key.high-volume.total-time", delta_seconds)
|
||||||
statsd_client.timing("email.high-volume.total-time", delta_seconds)
|
else:
|
||||||
else:
|
statsd_client.timing("email.live-key.not-high-volume.total-time", delta_seconds)
|
||||||
statsd_client.timing("email.not-high-volume.total-time", delta_seconds)
|
|
||||||
|
|
||||||
|
|
||||||
def update_notification_to_sending(notification, provider):
|
def update_notification_to_sending(notification, provider):
|
||||||
|
|||||||
Reference in New Issue
Block a user