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

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

Issue 23963002: Update V8ObjectStatsMetric to work as a standalone metric (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 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/v8_object_stats.py
diff --git a/tools/perf/metrics/v8_object_stats.py b/tools/perf/metrics/v8_object_stats.py
index 79b0fad92e0d8f57e7d6c9ceb456fc1465b9fdef..c29ce90694970b21023d39d87a980078488eddaa 100644
--- a/tools/perf/metrics/v8_object_stats.py
+++ b/tools/perf/metrics/v8_object_stats.py
@@ -32,7 +32,7 @@ _COUNTER_NAMES = [
'V8.MemoryPropertyCellSpaceBytesUsed',
'V8.MemoryLoSpaceBytesAvailable',
'V8.MemoryLoSpaceBytesCommitted',
- 'V8.MemoryLoSpaceBytesUsed)',
rmcilroy 2013/09/04 18:09:21 oops, thanks!
+ 'V8.MemoryLoSpaceBytesUsed',
'V8.SizeOf_ACCESSOR_PAIR_TYPE',
'V8.SizeOf_ACCESS_CHECK_INFO_TYPE',
'V8.SizeOf_ALIASED_ARGUMENTS_ENTRY_TYPE',
@@ -164,6 +164,25 @@ class V8ObjectStatsMetric(Metric):
options.AppendExtraBrowserArg('--enable-benchmarking')
options.AppendExtraBrowserArg(
'--js-flags=--track_gc_object_stats --expose_gc')
+ options.AppendExtraBrowserArg('--no-sandbox')
tonyg 2013/09/04 17:41:11 I don't see how this is related. Can you explain w
edmundyan 2013/09/04 17:53:41 I needed to add this line over in endure.py, other
rmcilroy 2013/09/04 18:09:21 Ahh yes, this is required for --enable-stats-table
edmundyan 2013/09/04 18:54:02 Done. /me wonders if there are other browser optio
+
+ @staticmethod
+ def GetV8StatsTable(tab, counters=None):
+ if counters is None:
+ counters = _COUNTER_NAMES
tonyg 2013/09/04 17:41:11 Rather than this, can't you just do counters=_COUN
edmundyan 2013/09/04 17:53:41 That is what I did originally, but pylint didn't l
rmcilroy 2013/09/04 18:09:21 Maybe just: counters = counters or _COUNTER_NAMES
edmundyan 2013/09/04 18:54:02 Done.
+
+ return tab.EvaluateJavaScript("""
+ (function(counters) {
+ var results = {};
+ if (!window.chrome || !window.chrome.benchmarking)
+ return results;
+ window.gc(); // Trigger GC to ensure stats are checkpointed.
+ for (var i = 0; i < counters.length; i++)
+ results[counters[i]] =
+ chrome.benchmarking.counterForRenderer(counters[i]);
+ return results;
+ })(%s);
+ """ % json.dumps(counters))
def Start(self, page, tab):
"""Do Nothing."""
@@ -171,17 +190,7 @@ class V8ObjectStatsMetric(Metric):
def Stop(self, page, tab):
"""Get the values in the stats table after the page is loaded."""
- self._results = tab.EvaluateJavaScript("""
- (function(counters) {
- var results = {};
- if (!window.chrome || !window.chrome.benchmarking)
- return results;
- window.gc(); // Trigger GC to ensure stats are checkpointed.
- for (var i = 0; i < counters.length; i++)
- results[counters[i]] = chrome.benchmarking.counterForRenderer(counters[i]);
- return results;
- })(%s);
- """ % json.dumps(_COUNTER_NAMES))
+ self._results = V8ObjectStatsMetric.GetV8StatsTable(tab)
if not self._results:
logging.warning('No V8 object stats from website: ' + page.display_url)
« 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