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

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

Issue 1400083003: Convert V8GCTimes measurement to timeline based measurement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix copyright date Created 5 years, 2 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
Index: tools/perf/metrics/v8_gc_times_metric.py
diff --git a/tools/perf/measurements/v8_gc_times.py b/tools/perf/metrics/v8_gc_times_metric.py
similarity index 86%
copy from tools/perf/measurements/v8_gc_times.py
copy to tools/perf/metrics/v8_gc_times_metric.py
index b7e7e8ea46ad765ed83c52e2c2ddb5df639b8a60..bbd1a1425e0b809bfc46cf18f450d4c5c1388048 100644
--- a/tools/perf/measurements/v8_gc_times.py
+++ b/tools/perf/metrics/v8_gc_times_metric.py
@@ -2,49 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from telemetry.page import page_test
-from telemetry.timeline.model import TimelineModel
-from telemetry.timeline import tracing_category_filter
-from telemetry.timeline import tracing_options
from telemetry.util import statistics
from telemetry.value import scalar
+from telemetry.web_perf.metrics import timeline_based_metric
-class V8GCTimes(page_test.PageTest):
-
- _TIME_OUT_IN_SECONDS = 60
- _CATEGORIES = ['blink.console',
- 'renderer.scheduler',
- 'v8',
- 'webkit.console']
+class V8GCTimesMetric(timeline_based_metric.TimelineBasedMetric):
_RENDERER_MAIN_THREAD = 'CrRendererMain'
_IDLE_TASK_PARENT = 'SingleThreadIdleTaskRunner::RunTask'
def __init__(self):
- super(V8GCTimes, self).__init__()
-
- def WillNavigateToPage(self, page, tab):
- category_filter = tracing_category_filter.TracingCategoryFilter()
-
- for category in self._CATEGORIES:
- category_filter.AddIncludedCategory(category)
+ super(V8GCTimesMetric, self).__init__()
- options = tracing_options.TracingOptions()
- options.enable_chrome_trace = True
-
- tab.browser.platform.tracing_controller.Start(
- options, category_filter, self._TIME_OUT_IN_SECONDS)
-
- def ValidateAndMeasurePage(self, page, tab, results):
- trace_data = tab.browser.platform.tracing_controller.Stop()
- timeline_model = TimelineModel(trace_data)
- renderer_process = timeline_model.GetRendererProcessFromTabId(tab.id)
+ def AddResults(self, model, renderer_thread, interaction_records, results):
+ renderer_process = renderer_thread.parent
self._AddV8MetricsToResults(renderer_process, results)
- def DidRunPage(self, platform):
- if platform.tracing_controller.is_tracing_running:
- platform.tracing_controller.Stop()
-
def _AddV8MetricsToResults(self, process, results):
if process is None:
return
@@ -189,7 +162,7 @@ def _ParentIdleTask(event):
parent = event.parent_slice
while parent:
# pylint: disable=protected-access
- if parent.name == V8GCTimes._IDLE_TASK_PARENT:
+ if parent.name == V8GCTimesMetric._IDLE_TASK_PARENT:
return parent
parent = parent.parent_slice
return None

Powered by Google App Engine
This is Rietveld 408576698