Commit f0c8bb74 authored by tonyg@chromium.org's avatar tonyg@chromium.org

[Telemetry] Allow page cycler to run on devices that don't report CommitCharge.

BUG=400734

Review URL: https://codereview.chromium.org/440323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287756 0039d316-1c4b-4281-b951-d872f2087c98
parent eae6aa4e
......@@ -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,6 +128,7 @@ class MemoryMetric(Metric):
AddResultsForProcesses(results, self._memory_stats,
metric_trace_name=trace_name)
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(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment