Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Unified Diff: tools/perf/perf_tools/histogram.py

Issue 13119014: Telemetry: Don't silently compare histograms from different processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/histogram_base.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/perf_tools/histogram.py
diff --git a/tools/perf/perf_tools/histogram.py b/tools/perf/perf_tools/histogram.py
index c5cbb2ebce57abbaf050344c6bca2beb9cf979b5..5567d53566a8676eca3c2fdf76b6bebd8c78970d 100644
--- a/tools/perf/perf_tools/histogram.py
+++ b/tools/perf/perf_tools/histogram.py
@@ -13,12 +13,18 @@ def SubtractHistogram(histogram_json, start_histogram_json):
if 'buckets' not in start_histogram:
return histogram_json
+ histogram = json.loads(histogram_json)
+ if ('pid' in start_histogram and 'pid' in histogram
+ and start_histogram['pid'] != histogram['pid']):
+ raise Exception(
+ 'Trying to compare histograms from different processes (%d and %d)'
+ % (start_histogram['pid'], histogram['pid']))
+
start_histogram_buckets = dict()
for b in start_histogram['buckets']:
start_histogram_buckets[b['low']] = b['count']
new_buckets = []
- histogram = json.loads(histogram_json)
for b in histogram['buckets']:
new_bucket = b
low = b['low']
« no previous file with comments | « base/metrics/histogram_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698