Track the time spent sending notifications for each flip

This commit is contained in:
Pēteris Caune 2020-02-06 11:11:12 +02:00
parent 1b8460f39f
commit 4a7074418a
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2

View File

@ -25,12 +25,13 @@ def notify(flip_id, stdout):
check.project.set_next_nag_date()
# Send notifications
send_time = timezone.now()
send_start = timezone.now()
errors = flip.send_alerts()
for ch, error in errors:
stdout.write("ERROR: %s %s %s\n" % (ch.kind, ch.value, error))
statsd.timing("hc.sendalerts.dwellTime", send_time - flip.created)
statsd.timing("hc.sendalerts.dwellTime", send_start - flip.created)
statsd.timing("hc.sendalerts.sendTime", timezone.now() - send_start)
def notify_on_thread(flip_id, stdout):