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

Unified Diff: tools/perf/metrics/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: Minor change (to make what is happening more explicit) 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 | « tools/perf/metrics/histogram.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/memory.py
diff --git a/tools/perf/metrics/memory.py b/tools/perf/metrics/memory.py
index 74fe26efe0bf60da53e3cceecc93f05ecb6e1848..fc9159311cd473d683153885e40824328b752041 100644
--- a/tools/perf/metrics/memory.py
+++ b/tools/perf/metrics/memory.py
@@ -41,6 +41,7 @@ class MemoryMetric(Metric):
"""
for h in _HISTOGRAMS:
histogram_data = histogram.GetHistogramData(h['type'], h['name'], tab)
+ # Histogram data may not be available
qyearsley 2013/08/12 20:57:48 Not sure if it's best not to repeat this comment b
if not histogram_data:
continue
self._histogram_start_values[h['name']] = histogram_data
@@ -53,14 +54,20 @@ class MemoryMetric(Metric):
"""
assert self._histogram_start_values, 'Must call Start() first'
for h in _HISTOGRAMS:
+ # Histogram data may not be available
+ if h['name'] not in self._histogram_start_values:
+ continue
histogram_data = histogram.GetHistogramData(h['type'], h['name'], tab)
- self._histogram_delta_values = histogram.SubtractHistogram(
+ self._histogram_delta_values[h['name']] = histogram.SubtractHistogram(
qyearsley 2013/08/12 20:57:48 I forgot to use self._histogram_delta_values as a
histogram_data, self._histogram_start_values[h['name']])
qyearsley 2013/08/12 20:57:48 Here (and in AddResults) I'm assuming that if hist
def AddResults(self, tab, results):
"""Add results for this page to the results object."""
assert self._histogram_delta_values, 'Must call Stop() first'
for h in _HISTOGRAMS:
+ # Histogram data may not be available
+ if h['name'] not in self._histogram_delta_values:
+ continue
histogram_data = self._histogram_delta_values[h['name']]
results.Add(h['name'], h['units'], histogram_data,
data_type='unimportant-histogram')
« no previous file with comments | « tools/perf/metrics/histogram.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698