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

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

Issue 12221137: Telemetry / Memory benchmark fix: Separate histograms for different tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add error msg if we do nonsensemaking histogram stuff Created 7 years, 10 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 | « tools/perf/perf_tools/histogram_unittest.py ('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/memory_benchmark.py
diff --git a/tools/perf/perf_tools/memory_benchmark.py b/tools/perf/perf_tools/memory_benchmark.py
index 27405734b3ba28f3a0526a2c1ab236139d32bf91..7179bf5563f0686e7028153b0502917ab4eaba3a 100644
--- a/tools/perf/perf_tools/memory_benchmark.py
+++ b/tools/perf/perf_tools/memory_benchmark.py
@@ -1,6 +1,7 @@
# Copyright (c) 2012 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.
+from perf_tools import histogram_measurement
from telemetry import multi_page_benchmark
MEMORY_HISTOGRAMS = [
@@ -15,6 +16,17 @@ BROWSER_MEMORY_HISTOGRAMS = [
class MemoryBenchmark(multi_page_benchmark.MultiPageBenchmark):
def __init__(self):
super(MemoryBenchmark, self).__init__('stress_memory')
+ self.histograms = (
+ [histogram_measurement.HistogramMeasurement(
+ h, histogram_measurement.RENDERER_HISTOGRAM)
+ for h in MEMORY_HISTOGRAMS] +
+ [histogram_measurement.HistogramMeasurement(
+ h, histogram_measurement.BROWSER_HISTOGRAM)
+ for h in BROWSER_MEMORY_HISTOGRAMS])
+
+ def DidNavigateToPage(self, page, tab):
+ for h in self.histograms:
+ h.Start(page, tab)
def CustomizeBrowserOptions(self, options):
options.AppendExtraBrowserArg('--dom-automation')
@@ -31,18 +43,5 @@ class MemoryBenchmark(multi_page_benchmark.MultiPageBenchmark):
return hasattr(page, 'stress_memory')
def MeasurePage(self, page, tab, results):
- for histogram in MEMORY_HISTOGRAMS:
- self._GetHistogramFromDomAutomation(tab, 'getHistogram', histogram,
- results)
- for histogram in BROWSER_MEMORY_HISTOGRAMS:
- self._GetHistogramFromDomAutomation(tab, 'getBrowserHistogram', histogram,
- results)
-
- def _GetHistogramFromDomAutomation(self, tab, func, histogram, results):
- name = histogram['name']
- js = ('window.domAutomationController.%s ? '
- 'window.domAutomationController.%s("%s") : ""' % (func, func, name))
- data = tab.EvaluateJavaScript(js)
- if data:
- results.Add(name.replace('.', '_'), histogram['units'], data,
- data_type='histogram')
+ for h in self.histograms:
+ h.GetValue(page, tab, results)
« no previous file with comments | « tools/perf/perf_tools/histogram_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698