From 8dd4bf8f00dff16d5a7987f72f3015bbff98a69a Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Wed, 6 Nov 2013 11:23:19 -0500 Subject: [PATCH] [puppet] Log endtoend send time on a per-realm basis as well as aggregate (imported from commit 07226b20081d203af1f52776475228d9b6783869) --- puppet/zulip_internal/files/graphite/aggregation-rules.conf | 3 +++ zerver/views/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/puppet/zulip_internal/files/graphite/aggregation-rules.conf b/puppet/zulip_internal/files/graphite/aggregation-rules.conf index 716b687c6d..b2500abda0 100644 --- a/puppet/zulip_internal/files/graphite/aggregation-rules.conf +++ b/puppet/zulip_internal/files/graphite/aggregation-rules.conf @@ -44,3 +44,6 @@ stats_counts..cache.all.miss (5) = sum stats_counts..cache.*.miss # Aggregate all per-domain active stats to overall active stats stats.gauges..users.active.all. (5) = sum stats.gauges..users.active.*. stats.gauges..users.reading.all. (5) = sum stats.gauges..users.reading.*. + +# Aggregate all per-realm end-to-end send stats to overall +stats.timers..endtoend.send_time.all (5) = sum stats.timers..endtoend.send_time.* diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index 17b73e8fa6..d4f3849950 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -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