[puppet] Log endtoend send time on a per-realm basis as well as aggregate

(imported from commit 07226b20081d203af1f52776475228d9b6783869)
This commit is contained in:
Leo Franchi 2013-11-06 11:23:19 -05:00
parent 74d1a56c68
commit 8dd4bf8f00
2 changed files with 5 additions and 2 deletions

View File

@ -44,3 +44,6 @@ stats_counts.<app>.cache.all.miss (5) = sum stats_counts.<app>.cache.*.miss
# Aggregate all per-domain active stats to overall active stats
stats.gauges.<app>.users.active.all.<bucket> (5) = sum stats.gauges.<app>.users.active.*.<bucket>
stats.gauges.<app>.users.reading.all.<bucket> (5) = sum stats.gauges.<app>.users.reading.*.<bucket>
# Aggregate all per-realm end-to-end send stats to overall
stats.timers.<app>.endtoend.send_time.all (5) = sum stats.timers.<app>.endtoend.send_time.*

View File

@ -64,7 +64,7 @@ from zerver.lib.response import json_success, json_error, json_response, json_me
from zerver.lib.cache import generic_bulk_cached_fetch
from zerver.lib.unminify import SourceMap
from zerver.lib.queue import queue_json_publish
from zerver.lib.utils import statsd, generate_random_token
from zerver.lib.utils import statsd, generate_random_token, statsd_key
from zerver import tornado_callbacks
from django.db import connection
@ -1881,7 +1881,7 @@ if not (settings.DEBUG or settings.TEST_SUITE):
def json_report_send_time(request, user_profile,
time=REQ(converter=to_non_negative_int)):
logging.info("End-to-end send time: %dms (%s)" % (time, user_profile.email))
statsd.timing("endtoend.send_time", time)
statsd.timing("endtoend.send_time.%s" % (statsd_key(user_profile.realm.domain),), time)
return json_success()
@authenticated_json_post_view