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

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

Issue 440323002: [Telemetry] Allow page cycler to run on devices that don't report CommitCharge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | 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 2a608659228bf57df081f1f014d8cd700ba22ea7..0d433a6bf73ba77e8428d82897e62f4dcfb645e6 100644
--- a/tools/perf/metrics/memory.py
+++ b/tools/perf/metrics/memory.py
@@ -59,7 +59,10 @@ class MemoryMetric(Metric):
def __init__(self, browser):
super(MemoryMetric, self).__init__()
self._browser = browser
- self._start_commit_charge = self._browser.memory_stats['SystemCommitCharge']
+ start_memory_stats = self._browser.memory_stats
+ self._start_commit_charge = None
+ if 'SystemCommitCharge' in start_memory_stats:
+ self._start_commit_charge = start_memory_stats['SystemCommitCharge']
self._memory_stats = None
self._histogram_start = dict()
self._histogram_delta = dict()
@@ -125,13 +128,14 @@ class MemoryMetric(Metric):
AddResultsForProcesses(results, self._memory_stats,
metric_trace_name=trace_name)
- end_commit_charge = self._memory_stats['SystemCommitCharge']
- commit_charge_difference = end_commit_charge - self._start_commit_charge
- results.AddValue(scalar.ScalarValue(
- results.current_page,
- 'commit_charge.' + (trace_name or 'commit_charge'),
- 'kb', commit_charge_difference, important=False,
- description='System commit charge (committed memory pages).'))
+ if self._start_commit_charge:
+ end_commit_charge = self._memory_stats['SystemCommitCharge']
+ commit_charge_difference = end_commit_charge - self._start_commit_charge
+ results.AddValue(scalar.ScalarValue(
+ results.current_page,
+ 'commit_charge.' + (trace_name or 'commit_charge'),
+ 'kb', commit_charge_difference, important=False,
+ description='System commit charge (committed memory pages).'))
results.AddValue(scalar.ScalarValue(
results.current_page, 'processes.' + (trace_name or 'processes'),
'count', self._memory_stats['ProcessCount'], important=False,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698