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

Unified Diff: tools/perf/benchmarks/indexeddb_perf.py

Issue 123553003: Added memory and V8 metrics to indexeddb_perf results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-results
Patch Set: Created 6 years, 12 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/benchmarks/indexeddb_perf.py
diff --git a/tools/perf/benchmarks/indexeddb_perf.py b/tools/perf/benchmarks/indexeddb_perf.py
index 8cf33e5d398b6b9cb40dc27f9ddab1dcd73e7680..b2ad0b31e51f05c650b20752ab77dd851cca6251 100644
--- a/tools/perf/benchmarks/indexeddb_perf.py
+++ b/tools/perf/benchmarks/indexeddb_perf.py
@@ -23,18 +23,44 @@ Cursors:
import json
import os
+from metrics import memory
+from metrics import v8_object_stats
from telemetry import test
from telemetry.core import util
from telemetry.page import page_measurement
from telemetry.page import page_set
+_V8_COUNTER_NAMES = [
+ 'V8.OsMemoryAllocated',
+ ]
class _IndexedDbMeasurement(page_measurement.PageMeasurement):
- def MeasurePage(self, _, tab, results):
+ def __init__(self, *args, **kwargs):
+ super(_IndexedDbMeasurement, self).__init__(*args, **kwargs)
+ self._memory_metric = None
+ self._v8_object_stats_metric = None
+
+ def DidStartBrowser(self, browser):
+ """Initialize metrics once right after the browser has been launched."""
+ self._memory_metric = memory.MemoryMetric(browser)
+ self._v8_object_stats_metric = \
+ v8_object_stats.V8ObjectStatsMetric(_V8_COUNTER_NAMES)
+
+ def DidNavigateToPage(self, page, tab):
+ self._memory_metric.Start(page, tab)
+ self._v8_object_stats_metric.Start(page, tab)
+
+ def MeasurePage(self, page, tab, results):
tab.WaitForDocumentReadyStateToBeComplete()
tab.WaitForJavaScriptExpression(
'window.document.cookie.indexOf("__done=1") >= 0', 600)
+ self._memory_metric.Stop(page, tab)
+ self._v8_object_stats_metric.Stop(page, tab)
+
+ self._memory_metric.AddResults(tab, results)
+ self._v8_object_stats_metric.AddResults(tab, results)
+
js_get_results = "JSON.stringify(automation.getResults());"
result_dict = json.loads(tab.EvaluateJavaScript(js_get_results))
total = 0.0
@@ -44,7 +70,11 @@ class _IndexedDbMeasurement(page_measurement.PageMeasurement):
msec = float(result_dict[key])
results.Add(key, 'ms', msec, data_type='unimportant')
total += msec
- results.Add('Total', 'ms', total)
+ results.Add('Total Perf', 'ms', total)
+
+ def CustomizeBrowserOptions(self, options):
+ memory.MemoryMetric.CustomizeBrowserOptions(options)
+ v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options)
class IndexedDb(test.Test):
"""Chromium's IndexedDB Performance tests."""
« 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