Only log valid stats to statsd

(imported from commit 449b7f5e750913c04e4df8f2a895274ded99ddd9)
This commit is contained in:
Leo Franchi 2013-11-06 15:41:46 -05:00
parent a32b47f7d6
commit 591d06cb24

View File

@ -1884,8 +1884,10 @@ def json_report_send_time(request, user_profile,
displayed=REQ(converter=to_non_negative_int, default="(unknown)")):
logging.info("End-to-end send time: %sms/%sms/%sms (%s)" % (time, received, displayed, user_profile.email))
statsd.timing("endtoend.send_time.%s" % (statsd_key(user_profile.realm.domain),), time)
statsd.timing("endtoend.receive_time.%s" % (statsd_key(user_profile.realm.domain),), received)
statsd.timing("endtoend.displayed_time.%s" % (statsd_key(user_profile.realm.domain),), displayed)
if received != "(unknown)":
statsd.timing("endtoend.receive_time.%s" % (statsd_key(user_profile.realm.domain),), received)
if displayed != "(unknown)":
statsd.timing("endtoend.displayed_time.%s" % (statsd_key(user_profile.realm.domain),), displayed)
return json_success()
@authenticated_json_post_view