Chromium Code Reviews| 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) |