Commit 006d5c21 authored by Ehsan Chiniforooshan's avatar Ehsan Chiniforooshan Committed by Commit Bot

Telemetry: remove smoothness measurement

This should be submitted after https://chromium-review.googlesource.com/c/catapult/+/1286371

Bug: 890757
Change-Id: I1185895b778024fd8c2f64a6597899cb717c6610
Reviewed-on: https://chromium-review.googlesource.com/c/1287029Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarRavi Mistry <rmistry@chromium.org>
Commit-Queue: Ehsan Chiniforooshan <chiniforooshan@chromium.org>
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#602227}
parent 8ae18f7b
......@@ -4,21 +4,26 @@
from core import perf_benchmark
from benchmarks import silk_flags
from measurements import smoothness
import page_sets
from telemetry import benchmark
from telemetry import story as story_module
from telemetry.timeline import chrome_trace_category_filter
from telemetry.web_perf import timeline_based_measurement
class _Smoothness(perf_benchmark.PerfBenchmark):
"""Base class for smoothness-based benchmarks."""
test = smoothness.Smoothness
@classmethod
def Name(cls):
return 'smoothness'
def CreateCoreTimelineBasedMeasurementOptions(self):
category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
options = timeline_based_measurement.Options(category_filter)
options.SetTimelineBasedMetrics(['renderingMetric'])
return options
@benchmark.Info(emails=['bokan@chromium.org'], component='Blink>Scroll')
class SmoothnessToughPinchZoomCases(_Smoothness):
......@@ -39,7 +44,6 @@ class SmoothnessGpuRasterizationToughPinchZoomCases(_Smoothness):
cases with GPU rasterization.
"""
tag = 'gpu_rasterization'
test = smoothness.Smoothness
page_set = page_sets.AndroidToughPinchZoomCasesPageSet
SUPPORTED_PLATFORMS = [story_module.expectations.ALL_MOBILE]
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from contrib.cluster_telemetry import repaint_helpers
from telemetry import decorators
from telemetry.page import page as page_module
from telemetry.testing import options_for_unittests
from telemetry.testing import page_test_test_case
from telemetry.util import wpr_modes
from measurements import smoothness
class TestRepaintPage(page_module.Page):
def __init__(self, page_set, base_dir):
super(TestRepaintPage, self).__init__('file://blank.html',
page_set, base_dir)
def RunPageInteractions(self, action_runner):
repaint_helpers.Repaint(action_runner)
class RepaintUnitTest(page_test_test_case.PageTestTestCase):
"""Smoke test for repaint measurement
Runs repaint measurement on a simple page and verifies
that all metrics were added to the results. The test is purely functional,
i.e. it only checks if the metrics are present and non-zero.
"""
def setUp(self):
self._options = options_for_unittests.GetCopy()
self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
# Previously this test was disabled on chromeos, see crbug.com/483212.
@decorators.Disabled("all") # crbug.com/715962
def testRepaint(self):
ps = self.CreateEmptyPageSet()
ps.AddStory(TestRepaintPage(ps, ps.base_dir))
measurement = smoothness.Smoothness()
results = self.RunMeasurement(measurement, ps, options=self._options)
self.assertFalse(results.had_failures)
frame_times = results.FindAllPageSpecificValuesNamed('frame_times')
self.assertEquals(len(frame_times), 1)
self.assertGreater(frame_times[0].GetRepresentativeNumber(), 0)
mean_frame_time = results.FindAllPageSpecificValuesNamed('mean_frame_time')
self.assertEquals(len(mean_frame_time), 1)
self.assertGreater(mean_frame_time[0].GetRepresentativeNumber(), 0)
frame_time_discrepancy = results.FindAllPageSpecificValuesNamed(
'frame_time_discrepancy')
self.assertEquals(len(frame_time_discrepancy), 1)
self.assertGreater(frame_time_discrepancy[0].GetRepresentativeNumber(), 0)
percentage_smooth = results.FindAllPageSpecificValuesNamed(
'percentage_smooth')
self.assertEquals(len(percentage_smooth), 1)
self.assertGreaterEqual(percentage_smooth[0].GetRepresentativeNumber(), 0)
# Make sure that we don't have extra timeline based metrics that are not
# related to smoothness.
mainthread_jank = results.FindAllPageSpecificValuesNamed(
'responsive-total_big_jank_thread_time')
self.assertEquals(len(mainthread_jank), 0)
......@@ -3,18 +3,24 @@
# found in the LICENSE file.
from core import perf_benchmark
from measurements import smoothness
import page_sets
from telemetry import benchmark
from telemetry import story as story_module
from telemetry.timeline import chrome_trace_category_filter
from telemetry.web_perf import timeline_based_measurement
@benchmark.Info(emails=['chiniforooshan@chromium.org', 'sadrul@chromium.org'])
class CrosUiSmoothnessBenchmark(perf_benchmark.PerfBenchmark):
"""Measures ChromeOS UI smoothness."""
test = smoothness.Smoothness
page_set = page_sets.CrosUiCasesPageSet
SUPPORTED_PLATFORMS = [story_module.expectations.ALL_CHROMEOS]
@classmethod
def Name(cls):
return 'cros_ui_smoothness'
def CreateCoreTimelineBasedMeasurementOptions(self):
category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
options = timeline_based_measurement.Options(category_filter)
options.SetTimelineBasedMetrics(['renderingMetric'])
return options
......@@ -6,7 +6,6 @@ import logging
from benchmarks import memory
from core import perf_benchmark
from measurements import smoothness
from telemetry import benchmark
from telemetry import story
from telemetry.timeline import chrome_trace_category_filter
......@@ -210,7 +209,11 @@ class XrBrowsingWprStatic(_BaseBrowsingBenchmark):
class XrBrowsingWprSmoothness(_BaseBrowsingBenchmark):
"""Benchmark for testing VR browser scrolling smoothness and throughput."""
test = smoothness.Smoothness
def CreateCoreTimelineBasedMeasurementOptions(self):
category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
options = timeline_based_measurement.Options(category_filter)
options.SetTimelineBasedMetrics(['renderingMetric'])
return options
def CreateStorySet(self, options):
return vr_browsing_mode_pages.VrBrowsingModeWprSmoothnessPageSet()
......
......@@ -5,7 +5,6 @@
from telemetry.page import legacy_page_test
from telemetry.timeline import model as model_module
from telemetry.value import trace
from telemetry.web_perf.metrics import smoothness
from telemetry.web_perf import smooth_gesture_util
from telemetry.web_perf import timeline_interaction_record as tir_module
from telemetry.timeline import tracing_config
......@@ -79,9 +78,6 @@ class Rendering(legacy_page_test.LegacyPageTest):
renderer_thread = model.GetFirstRendererThread(tab.id)
records = _CollectRecordsFromRendererThreads(model, renderer_thread)
smoothness_metric = smoothness.SmoothnessMetric()
smoothness_metric.AddResults(model, renderer_thread, records, results)
thread_times_metric = timeline.ThreadTimesTimelineMetric()
thread_times_metric.AddResults(model, renderer_thread, records, results)
......
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import legacy_page_test
from telemetry.timeline import model as model_module
from telemetry.value import trace
from telemetry.web_perf.metrics import smoothness
from telemetry.web_perf import smooth_gesture_util
from telemetry.web_perf import timeline_interaction_record as tir_module
from telemetry.timeline import tracing_config
from measurements import rendering_util
def _CollectRecordsFromRendererThreads(model, renderer_thread):
records = []
for event in renderer_thread.async_slices:
if tir_module.IsTimelineInteractionRecord(event.name):
interaction = tir_module.TimelineInteractionRecord.FromAsyncEvent(event)
# Adjust the interaction record to match the synthetic gesture
# controller if needed.
interaction = (
smooth_gesture_util.GetAdjustedInteractionIfContainGesture(
model, interaction))
records.append(interaction)
return records
class Smoothness(legacy_page_test.LegacyPageTest):
def __init__(self):
super(Smoothness, self).__init__()
self._results = None
@classmethod
def CustomizeBrowserOptions(cls, options):
options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
options.AppendExtraBrowserArgs('--touch-events=enabled')
def WillNavigateToPage(self, page, tab):
# FIXME: Remove webkit.console when blink.console lands in chromium and
# the ref builds are updated. crbug.com/386847
config = tracing_config.TracingConfig()
config.enable_chrome_trace = True
config.enable_platform_display_trace = True
# Basic categories for smoothness.
custom_categories = [
'webkit.console', 'blink.console', 'benchmark', 'trace_event_overhead']
for cat in custom_categories:
config.chrome_trace_config.category_filter.AddFilterString(cat)
# Extra categories from commandline flag.
if self.options and self.options.extra_chrome_categories:
config.chrome_trace_config.category_filter.AddFilterString(
self.options.extra_chrome_categories)
if self.options and self.options.enable_systrace:
config.chrome_trace_config.SetEnableSystrace()
tab.browser.platform.tracing_controller.StartTracing(config)
def ValidateAndMeasurePage(self, _, tab, results):
self._results = results
tab.browser.platform.tracing_controller.telemetry_info = (
results.telemetry_info)
trace_result = tab.browser.platform.tracing_controller.StopTracing()[0]
trace_value = trace.TraceValue(
results.current_page, trace_result,
file_path=results.telemetry_info.trace_local_path,
remote_path=results.telemetry_info.trace_remote_path,
upload_bucket=results.telemetry_info.upload_bucket,
cloud_url=results.telemetry_info.trace_remote_url)
results.AddValue(trace_value)
model = model_module.TimelineModel(trace_result)
renderer_thread = model.GetFirstRendererThread(tab.id)
records = _CollectRecordsFromRendererThreads(model, renderer_thread)
metric = smoothness.SmoothnessMetric()
metric.AddResults(model, renderer_thread, records, results)
rendering_util.AddTBMv2RenderingMetrics(
trace_value, results, import_experimental_metrics=False)
def DidRunPage(self, platform):
if platform.tracing_controller.is_tracing_running:
trace_result = platform.tracing_controller.StopTracing()[0]
if self._results:
trace_value = trace.TraceValue(
self._results.current_page, trace_result,
file_path=self._results.telemetry_info.trace_local_path,
remote_path=self._results.telemetry_info.trace_remote_path,
upload_bucket=self._results.telemetry_info.upload_bucket,
cloud_url=self._results.telemetry_info.trace_remote_url)
self._results.AddValue(trace_value)
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import decorators
from telemetry.testing import options_for_unittests
from telemetry.testing import page_test_test_case
from telemetry.util import wpr_modes
from measurements import smoothness
from measurements import rendering_util
class FakeTracingController(object):
def __init__(self):
self.config = None
def StartTracing(self, config):
self.config = config
def IsChromeTracingSupported(self):
return True
class FakePlatform(object):
def __init__(self):
self.tracing_controller = FakeTracingController()
class FakeBrowser(object):
def __init__(self):
self.platform = FakePlatform()
class FakeTab(object):
def __init__(self):
self.browser = FakeBrowser()
def CollectGarbage(self):
pass
def ExecuteJavaScript(self, js):
pass
class SmoothnessUnitTest(page_test_test_case.PageTestTestCase):
"""Smoke test for smoothness measurement
Runs smoothness measurement on a simple page and verifies
that all metrics were added to the results. The test is purely functional,
i.e. it only checks if the metrics are present and non-zero.
"""
def setUp(self):
self._options = options_for_unittests.GetCopy()
self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
# crbug.com/483212, crbug.com/713260, crbug.com/894622, crbug.com/895238
@decorators.Disabled('chromeos', 'linux', 'mac', 'win')
def testSmoothness(self):
ps = self.CreateStorySetFromFileInUnittestDataDir('scrollable_page.html')
measurement = smoothness.Smoothness()
results = self.RunMeasurement(measurement, ps, options=self._options)
self.assertFalse(results.had_failures)
stat = rendering_util.ExtractStat(results)
self.assertGreater(stat['frame_times'].mean, 0)
self.assertGreaterEqual(stat['percentage_smooth'].mean, 0)
@decorators.Enabled('android') # SurfaceFlinger is android-only
def testSmoothnessSurfaceFlingerMetricsCalculated(self):
ps = self.CreateStorySetFromFileInUnittestDataDir('scrollable_page.html')
measurement = smoothness.Smoothness()
results = self.RunMeasurement(measurement, ps, options=self._options)
self.assertFalse(results.had_failures)
stat = rendering_util.ExtractStat(results)
self.assertGreater(stat['avg_surface_fps'].mean, 0)
self.assertGreater(stat['jank_count'].mean, -1)
self.assertGreater(stat['frame_lengths'].mean, 0)
def testCleanUpTrace(self):
self.TestTracingCleanedUp(smoothness.Smoothness, self._options)
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