From 21ab74fb5779635bbaf73433aa4eec6e29dbfcdd Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Mon, 13 Apr 2015 12:20:33 -0700 Subject: [PATCH] Rename timers for external services to share namespace. This moves the cloudsearch and geoip timers into a common namespace to clean up graphite and make it more clear what they are: * cloudsearch_timer -> providers.cloudsearch * geoip_service_timer -> providers.geoip.* --- r2/r2/lib/cloudsearch.py | 2 +- r2/r2/models/subreddit.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/r2/r2/lib/cloudsearch.py b/r2/r2/lib/cloudsearch.py index 23c48fa95..32e5b68ce 100644 --- a/r2/r2/lib/cloudsearch.py +++ b/r2/r2/lib/cloudsearch.py @@ -748,7 +748,7 @@ def basic_query(query=None, bq=None, faceting=None, size=1000, path = _encode_query(query, bq, faceting, size, start, rank, return_fields) timer = None if record_stats: - timer = g.stats.get_timer("cloudsearch_timer") + timer = g.stats.get_timer("providers.cloudsearch") timer.start() connection = httplib.HTTPConnection(search_api, port=80, timeout=_TIMEOUT) try: diff --git a/r2/r2/models/subreddit.py b/r2/r2/models/subreddit.py index 2acf70da2..72d1caf79 100644 --- a/r2/r2/models/subreddit.py +++ b/r2/r2/models/subreddit.py @@ -98,7 +98,7 @@ def get_request_location(): pass elif getattr(request, 'ip', None): g.stats.simple_event('geoip.non_cdn_request') - timer = g.stats.get_timer("geoip_service_timer") + timer = g.stats.get_timer("providers.geoip.location_by_ips") timer.start() location = location_by_ips(request.ip) if location: