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

Unified Diff: tools/perf/measurements/memory.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
« no previous file with comments | « no previous file | tools/perf/measurements/page_cycler.py » ('j') | tools/perf/measurements/page_cycler.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/memory.py
diff --git a/tools/perf/measurements/memory.py b/tools/perf/measurements/memory.py
index f15184af6ac4822476ec92981ffd01ec18c3ccc0..6aa88be67e27f4f22d3df0067a3f8802f9d20ddf 100644
--- a/tools/perf/measurements/memory.py
+++ b/tools/perf/measurements/memory.py
@@ -1,42 +1,20 @@
# 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 metrics import histogram
+
from metrics import memory
from telemetry.page import page_measurement
-
-MEMORY_HISTOGRAMS = [
- {'name': 'V8.MemoryExternalFragmentationTotal', 'units': 'percent'},
- {'name': 'V8.MemoryHeapSampleTotalCommitted', 'units': 'kb'},
- {'name': 'V8.MemoryHeapSampleTotalUsed', 'units': 'kb'},
- {'name': 'Memory.RendererUsed', 'units': 'kb'}]
-
-
-BROWSER_MEMORY_HISTOGRAMS = [
- {'name': 'Memory.BrowserUsed', 'units': 'kb'}]
-
-
class Memory(page_measurement.PageMeasurement):
def __init__(self):
super(Memory, self).__init__('stress_memory')
- self.histograms = (
- [histogram.HistogramMetric(
- h, histogram.RENDERER_HISTOGRAM)
- for h in MEMORY_HISTOGRAMS] +
- [histogram.HistogramMetric(
- h, histogram.BROWSER_HISTOGRAM)
- for h in BROWSER_MEMORY_HISTOGRAMS])
-
self._memory_metric = None
def DidStartBrowser(self, browser):
self._memory_metric = memory.MemoryMetric(browser)
- self._memory_metric.Start()
def DidNavigateToPage(self, page, tab):
- for h in self.histograms:
- h.Start(page, tab)
+ self._memory_metric.Start(page, tab)
def CustomizeBrowserOptions(self, options):
options.AppendExtraBrowserArg('--enable-stats-collection-bindings')
@@ -59,8 +37,8 @@ class Memory(page_measurement.PageMeasurement):
return hasattr(page, 'stress_memory')
def MeasurePage(self, page, tab, results):
- for h in self.histograms:
- h.GetValue(page, tab, results)
+ self._memory_metric.Stop(page, tab)
+ self._memory_metric.AddResults(tab, results)
if tab.browser.is_profiler_active('tcmalloc-heap'):
# The tcmalloc_heap_profiler dumps files at regular
@@ -75,6 +53,5 @@ class Memory(page_measurement.PageMeasurement):
""")
def DidRunTest(self, tab, results):
- self._memory_metric.Stop()
- self._memory_metric.AddResults(tab, results)
+ self._memory_metric.AddSummaryResults(results)
« no previous file with comments | « no previous file | tools/perf/measurements/page_cycler.py » ('j') | tools/perf/measurements/page_cycler.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698