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

Side by Side Diff: tools/perf/metrics/v8_object_stats.py

Issue 23545023: [Telemetry] Add 'name' attribute for pages, which allows for more human-readable printing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to update the unitttests :( Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import logging 6 import logging
7 7
8 from metrics import Metric 8 from metrics import Metric
9 9
10 _COUNTER_NAMES = [ 10 _COUNTER_NAMES = [
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 var results = {}; 176 var results = {};
177 if (!window.chrome || !window.chrome.benchmarking) 177 if (!window.chrome || !window.chrome.benchmarking)
178 return results; 178 return results;
179 window.gc(); // Trigger GC to ensure stats are checkpointed. 179 window.gc(); // Trigger GC to ensure stats are checkpointed.
180 for (var i = 0; i < counters.length; i++) 180 for (var i = 0; i < counters.length; i++)
181 results[counters[i]] = chrome.benchmarking.counterForRenderer(counters[i]); 181 results[counters[i]] = chrome.benchmarking.counterForRenderer(counters[i]);
182 return results; 182 return results;
183 })(%s); 183 })(%s);
184 """ % json.dumps(_COUNTER_NAMES)) 184 """ % json.dumps(_COUNTER_NAMES))
185 if not self._results: 185 if not self._results:
186 logging.warning('No V8 object stats from website: ' + page.display_url) 186 logging.warning('No V8 object stats from website: ' + page.display_name)
187 187
188 def AddResults(self, tab, results): 188 def AddResults(self, tab, results):
189 """Add results for this page to the results object.""" 189 """Add results for this page to the results object."""
190 assert self._results != None, 'Must call Stop() first' 190 assert self._results != None, 'Must call Stop() first'
191 for counter_name in self._results: 191 for counter_name in self._results:
192 results.Add(counter_name, 'kb', self._results[counter_name] / 1024.0) 192 results.Add(counter_name, 'kb', self._results[counter_name] / 1024.0)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698