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

Unified Diff: tools/perf/metrics/histogram_unittest.py

Issue 22492004: Move memory-related histogram data collection to metrics/memory.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
Index: tools/perf/metrics/histogram_unittest.py
diff --git a/tools/perf/metrics/histogram_util_unittest.py b/tools/perf/metrics/histogram_unittest.py
similarity index 60%
rename from tools/perf/metrics/histogram_util_unittest.py
rename to tools/perf/metrics/histogram_unittest.py
index 7db5558fb1a712150d9aca2e0022f621dbc68a2c..d692d6434d212aad144d8209220bce6282fc1ee6 100644
--- a/tools/perf/metrics/histogram_util_unittest.py
+++ b/tools/perf/metrics/histogram_unittest.py
@@ -1,24 +1,25 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
import json
import unittest
-from metrics import histogram_util
+from metrics import histogram
class TestHistogram(unittest.TestCase):
def testSubtractHistogram(self):
baseline_histogram = """{"count": 3, "buckets": [
-{"low": 1, "high": 2, "count": 1},
-{"low": 2, "high": 3, "count": 2}]}"""
+ {"low": 1, "high": 2, "count": 1},
+ {"low": 2, "high": 3, "count": 2}]}"""
- histogram = """{"count": 14, "buckets": [
-{"low": 1, "high": 2, "count": 1},
-{"low": 2, "high": 3, "count": 3},
-{"low": 3, "high": 4, "count": 10}]}"""
+ later_histogram = """{"count": 14, "buckets": [
+ {"low": 1, "high": 2, "count": 1},
+ {"low": 2, "high": 3, "count": 3},
+ {"low": 3, "high": 4, "count": 10}]}"""
new_histogram = json.loads(
- histogram_util.SubtractHistogram(histogram, baseline_histogram))
+ histogram.SubtractHistogram(later_histogram, baseline_histogram))
new_buckets = dict()
for b in new_histogram['buckets']:
new_buckets[b['low']] = b['count']

Powered by Google App Engine
This is Rietveld 408576698