Commit f22ad707 authored by tonyg@chromium.org's avatar tonyg@chromium.org

Revert of Telemetry: Initialize smoothness and thread_times metrics before...

Revert of Telemetry: Initialize smoothness and thread_times metrics before page load, not after. (https://codereview.chromium.org/392613002/)

Reason for revert:
Breaks smoothness tests on N4 (at least) with no frames error. Possible this is a legit perf regression? But reverting anyway to green things up.

http://build.chromium.org/p/chromium.perf/builders/Android%20Nexus5%20Perf/builds/1115

Original issue's description:
> Telemetry: Initialize smoothness and thread_times metrics before page load, not after.
> 
> Currently both smoothness and thread_times initialize their metrics after page
> load. This leads to a gap between the page load and the page actions starting.
> This patch moves the initialization before the page load, thus eliminating the
> gap. It is safe to do so because smoothness and thread_times require a page load
> before each run (even when repeating the same page).
> 
> Note to perf sheriffs:
> This patch is likely to cause performance numbers to worsen, because the browser is often more busy immediately after page load. If you get alerts related to this CL, feel free to ignore them. If there is a reference build for the bot, the number for the reference build should also change accordingly.
> 
> BUG=392895
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285297

TBR=skyostil@chromium.org,picksi@google.com,dominikg@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=392895

Review URL: https://codereview.chromium.org/419623002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285395 0039d316-1c4b-4281-b951-d872f2087c98
parent 0aebc251
......@@ -17,8 +17,7 @@ class LoadingTrace(page_measurement.PageMeasurement):
return False
def WillNavigateToPage(self, page, tab):
self._timeline_controller.SetUp(page, tab)
self._timeline_controller.Start(tab)
self._timeline_controller.Start(page, tab)
def MeasurePage(self, page, tab, results):
# In current telemetry tests, all tests wait for DocumentComplete state,
......
......@@ -35,8 +35,7 @@ class Repaint(page_measurement.PageMeasurement):
def WillRunActions(self, page, tab):
tab.WaitForDocumentReadyStateToBeComplete()
self._smoothness_controller = smoothness_controller.SmoothnessController()
self._smoothness_controller.SetUp(page, tab)
self._smoothness_controller.Start(tab)
self._smoothness_controller.Start(page, tab)
# Rasterize only what's visible.
tab.ExecuteJavaScript(
'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();')
......
......@@ -22,13 +22,10 @@ class Smoothness(page_measurement.PageMeasurement):
def WillStartBrowser(self, browser):
self._power_metric = power.PowerMetric(browser)
def WillNavigateToPage(self, page, tab):
def WillRunActions(self, page, tab):
self._power_metric.Start(page, tab)
self._smoothness_controller = smoothness_controller.SmoothnessController()
self._smoothness_controller.SetUp(page, tab)
def WillRunActions(self, page, tab):
self._smoothness_controller.Start(tab)
self._smoothness_controller.Start(page, tab)
def DidRunActions(self, page, tab):
self._power_metric.Stop(page, tab)
......
......@@ -27,7 +27,7 @@ class SmoothnessController(object):
self._tracing_timeline_data = None
self._interaction = None
def SetUp(self, page, tab):
def Start(self, page, tab):
# FIXME: Remove webkit.console when blink.console lands in chromium and
# the ref builds are updated. crbug.com/386847
custom_categories = ['webkit.console', 'blink.console', 'benchmark']
......@@ -35,8 +35,6 @@ class SmoothnessController(object):
tab.browser.StartTracing(','.join(custom_categories), 60)
if tab.browser.platform.IsRawDisplayFrameRateSupported():
tab.browser.platform.StartRawDisplayFrameRateMeasurement()
def Start(self, tab):
# Start the smooth marker for all smooth actions.
runner = action_runner.ActionRunner(tab)
self._interaction = runner.BeginInteraction(
......
......@@ -64,7 +64,6 @@ class SmoothnessUnitTest(
tab = FakeTab()
measurement = smoothness.Smoothness()
measurement.WillStartBrowser(tab.browser)
measurement.WillNavigateToPage(test_page, tab)
measurement.WillRunActions(test_page, tab)
expected_category_filter = [
......
......@@ -22,7 +22,7 @@ class ThreadTimes(page_measurement.PageMeasurement):
def results_are_the_same_on_every_page(self):
return False
def WillNavigateToPage(self, page, tab):
def WillRunActions(self, page, tab):
self._timeline_controller = timeline_controller.TimelineController()
if self.options.report_silk_details:
# We need the other traces in order to have any details to report.
......@@ -31,10 +31,7 @@ class ThreadTimes(page_measurement.PageMeasurement):
else:
self._timeline_controller.trace_categories = \
tracing_backend.MINIMAL_TRACE_CATEGORIES
self._timeline_controller.SetUp(page, tab)
def WillRunActions(self, page, tab):
self._timeline_controller.Start(tab)
self._timeline_controller.Start(page, tab)
def DidRunActions(self, page, tab):
self._timeline_controller.Stop(tab)
......
......@@ -21,7 +21,7 @@ class TimelineController(object):
self._smooth_records = []
self._interaction = None
def SetUp(self, page, tab):
def Start(self, page, tab):
"""Starts gathering timeline data.
"""
......@@ -36,8 +36,6 @@ class TimelineController(object):
else:
categories = page.GetSyntheticDelayCategories()
tab.browser.StartTracing(','.join(categories))
def Start(self, tab):
# Start the smooth marker for all actions.
runner = action_runner.ActionRunner(tab)
self._interaction = runner.BeginInteraction(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment