summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorcmumford@chromium.org <cmumford@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 21:51:46 +0000
committercmumford@chromium.org <cmumford@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 21:51:46 +0000
commit8e74bddbf8dc5414f305c7f88fd29154d5f37ac0 (patch)
treec4238dd40ad491bb4cadde3c428e46a7f558ea8d /tools
parent331e4dbaa47352f97efdb6a173b9141945ebfd20 (diff)
downloadchromium_src-8e74bddbf8dc5414f305c7f88fd29154d5f37ac0.zip
chromium_src-8e74bddbf8dc5414f305c7f88fd29154d5f37ac0.tar.gz
chromium_src-8e74bddbf8dc5414f305c7f88fd29154d5f37ac0.tar.bz2
Allowing V8ObjectStatsMetric users to specify metrics to capture.
V8ObjectStatsMetric would previously capture all V8 statistics. Added a constructor parameter so that users could capture a subset of the V8 statistics if desired. Default is as before: capture them all. Making this change so that the IndexedDB perf tests (indexeddb_perf) can be modified to report only a few metrics to simplify the test results. Review URL: https://codereview.chromium.org/99903009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243394 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/metrics/v8_object_stats.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/metrics/v8_object_stats.py b/tools/perf/metrics/v8_object_stats.py
index d9d35f4..ca28121 100644
--- a/tools/perf/metrics/v8_object_stats.py
+++ b/tools/perf/metrics/v8_object_stats.py
@@ -162,9 +162,10 @@ class V8ObjectStatsMetric(Metric):
these statistics from the StatsTableMetric.
"""
- def __init__(self):
+ def __init__(self, counters=None):
super(V8ObjectStatsMetric, self).__init__()
self._results = None
+ self._counters = counters or _COUNTER_NAMES
@classmethod
def CustomizeBrowserOptions(cls, options):
@@ -178,8 +179,7 @@ class V8ObjectStatsMetric(Metric):
])
@staticmethod
- def GetV8StatsTable(tab, counters=None):
- counters = counters or _COUNTER_NAMES
+ def GetV8StatsTable(tab, counters):
return tab.EvaluateJavaScript("""
(function(counters) {
@@ -204,7 +204,7 @@ class V8ObjectStatsMetric(Metric):
def Stop(self, page, tab):
"""Get the values in the stats table after the page is loaded."""
- self._results = V8ObjectStatsMetric.GetV8StatsTable(tab)
+ self._results = V8ObjectStatsMetric.GetV8StatsTable(tab, self._counters)
if not self._results:
logging.warning('No V8 object stats from website: ' + page.display_name)