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

Unified Diff: tools/perf/measurements/tab_switching.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/measurements/tab_switching.py
diff --git a/tools/perf/measurements/tab_switching.py b/tools/perf/measurements/tab_switching.py
index d4d8e58d10a55441a9444f3f5baccc32f4ffa64d..39b76f4bcc711da6ccb7d9bf6d0674d7f313ef4d 100644
--- a/tools/perf/measurements/tab_switching.py
+++ b/tools/perf/measurements/tab_switching.py
@@ -9,7 +9,7 @@ it cycles through each tab in sequence, and records a histogram of the time
between when a tab was first requested to be shown, and when it was painted.
"""
-from metrics import histogram_util
+from metrics import histogram
from telemetry.core import util
from telemetry.page import page_measurement
from telemetry.page import page_runner
@@ -37,27 +37,27 @@ class TabSwitching(page_measurement.PageMeasurement):
thenrecord a single histogram for the tab switching metric.
"""
histogram_name = 'MPArch.RWH_TabSwitchPaintDuration'
- histogram_type = 'getBrowserHistogram'
- first_histogram = histogram_util.GetHistogramFromDomAutomation(
- histogram_type, histogram_name, tab)
+ histogram_type = histogram.BROWSER_HISTOGRAM
+ first_histogram = histogram.GetHistogramData(histogram_type,
+ histogram_name, tab)
prev_histogram = first_histogram
for i in xrange(len(tab.browser.tabs)):
t = tab.browser.tabs[i]
t.Activate()
def _IsDone():
- cur_histogram = histogram_util.GetHistogramFromDomAutomation(
- histogram_type, histogram_name, tab)
- diff_histogram = histogram_util.SubtractHistogram(
+ cur_histogram = histogram.GetHistogramData(
+ histogram_type,histogram_name, tab)
+ diff_histogram = histogram.SubtractHistogram(
cur_histogram, prev_histogram)
return diff_histogram
util.WaitFor(_IsDone, 30)
- prev_histogram = histogram_util.GetHistogramFromDomAutomation(
+ prev_histogram = histogram.GetHistogramData(
histogram_type, histogram_name, tab)
- last_histogram = histogram_util.GetHistogramFromDomAutomation(
+ last_histogram = histogram.GetHistogramData(
histogram_type, histogram_name, tab)
- diff_histogram = histogram_util.SubtractHistogram(last_histogram,
+ diff_histogram = histogram.SubtractHistogram(last_histogram,
first_histogram)
results.AddSummary(histogram_name, '', diff_histogram,

Powered by Google App Engine
This is Rietveld 408576698