Commit 8b3b4537 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[cluster_telemetry] Add v8.loading.cluster_telemetry benchmark

The new benchmark takes all the metrics from the v8.browsing benchmarks and
provides an additional --enable-rcs to switch on the more expensive runtime
call stats metrics.

- Introduce new _LoadingBaseClusterTelemetry base class
- Introduce AugmentOptionsForV8BrowsingMetrics and V8BrowsingShouldAddValue
  helpers to share metrics setup code with v8.browsing benchmarks
- Add new V8LoadingClusterTelemetry benchmark

Bug: chromium:883322
Change-Id: I67287fb046993a4cb687ac57073f81a7c006d361
Reviewed-on: https://chromium-review.googlesource.com/1224448
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592134}
parent 7966a719
......@@ -8,7 +8,6 @@ from core import perf_benchmark
from telemetry import benchmark
from telemetry import story
from telemetry.timeline import chrome_trace_config
from telemetry.timeline import chrome_trace_category_filter
from telemetry.web_perf import timeline_based_measurement
import page_sets
......@@ -30,6 +29,72 @@ _V8_GC_HIGH_LEVEL_STATS_RE = re.compile(r'^v8-gc-('
r'scavenger_|'
r'total_)')
def V8BrowsingShouldAddValue(name):
# TODO(crbug.com/775942): This is needed because of a race condition in
# the memory dump manager. Remove this once the bug is fixed.
if 'memory:unknown_browser' in name:
return ('renderer_processes' in name and
not _IGNORED_MEMORY_STATS_RE.search(name))
# TODO(crbug.com/610962): Remove this stopgap when the perf dashboard
# is able to cope with the data load generated by TBMv2 metrics.
if 'memory:chrome' in name:
return ('renderer_processes' in name and
not _IGNORED_MEMORY_STATS_RE.search(name))
if 'v8-gc' in name:
return (_V8_GC_HIGH_LEVEL_STATS_RE.search(name) and
not _IGNORED_V8_STATS_RE.search(name))
# Allow all other metrics.
return True
def AugmentOptionsForV8BrowsingMetrics(options, enable_runtime_call_stats=True):
categories = [
# Disable all categories by default.
'-*',
# Memory categories.
'disabled-by-default-memory-infra',
# UE categories required by runtimeStatsTotalMetric to bucket
# runtimeStats by UE.
'rail',
# EQT categories.
'blink.user_timing',
'loading',
'navigation',
'toplevel',
# V8 categories.
'disabled-by-default-v8.gc',
'renderer.scheduler',
'v8',
'v8.console',
'webkit.console',
# TODO(crbug.com/616441, primiano): Remove this temporary workaround,
# which enables memory-infra V8 code stats in V8 code size benchmarks
# only (to not slow down detailed memory dumps in other benchmarks).
'disabled-by-default-memory-infra.v8.code_stats',
# Blink categories.
'blink_gc',
]
options.ExtendTraceCategoryFilter(categories)
if enable_runtime_call_stats:
options.AddTraceCategoryFilter('disabled-by-default-v8.runtime_stats')
options.config.enable_android_graphics_memtrack = True
# Trigger periodic light memory dumps every 1000 ms.
memory_dump_config = chrome_trace_config.MemoryDumpConfig()
memory_dump_config.AddTrigger('light', 1000)
options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config)
metrics = [
'blinkGcMetric',
'consoleErrorMetric',
'expectedQueueingTimeMetric',
'gcMetric',
'memoryMetric',
]
options.ExtendTimelineBasedMetric(metrics)
if enable_runtime_call_stats:
options.AddTimelineBasedMetric('runtimeStatsTotalMetric')
return options
class _V8BrowsingBenchmark(perf_benchmark.PerfBenchmark):
"""Base class for V8 browsing benchmarks that measure RuntimeStats,
......@@ -41,70 +106,14 @@ class _V8BrowsingBenchmark(perf_benchmark.PerfBenchmark):
return page_sets.SystemHealthStorySet(platform=self.PLATFORM, case='browse')
def CreateCoreTimelineBasedMeasurementOptions(self):
categories = [
# Disable all categories by default.
'-*',
# Memory categories.
'disabled-by-default-memory-infra',
# UE categories requred by runtimeStatsTotalMetric to bucket
# runtimeStats by UE.
'rail',
# EQT categories.
'blink.user_timing',
'loading',
'navigation',
'toplevel',
# V8 categories.
'disabled-by-default-v8.gc',
'renderer.scheduler',
'v8',
'v8.console',
'webkit.console',
'disabled-by-default-v8.runtime_stats',
# TODO(crbug.com/616441, primiano): Remove this temporary workaround,
# which enables memory-infra V8 code stats in V8 code size benchmarks
# only (to not slow down detailed memory dumps in other benchmarks).
'disabled-by-default-memory-infra.v8.code_stats',
# Blink categories.
'blink_gc',
]
options = timeline_based_measurement.Options(
chrome_trace_category_filter.ChromeTraceCategoryFilter(
','.join(categories)))
options.config.enable_android_graphics_memtrack = True
# Trigger periodic light memory dumps every 1000 ms.
memory_dump_config = chrome_trace_config.MemoryDumpConfig()
memory_dump_config.AddTrigger('light', 1000)
options.config.chrome_trace_config.SetMemoryDumpConfig(memory_dump_config)
options.SetTimelineBasedMetrics([
'blinkGcMetric',
'consoleErrorMetric',
'expectedQueueingTimeMetric',
'gcMetric',
'memoryMetric',
'runtimeStatsTotalMetric'
])
options = timeline_based_measurement.Options()
AugmentOptionsForV8BrowsingMetrics(options)
return options
@classmethod
def ShouldAddValue(cls, name, from_first_story_run):
del from_first_story_run # unused
# TODO(crbug.com/775942): This is needed because of a race condition in
# the memory dump manager. Remove this once the bug is fixed.
if 'memory:unknown_browser' in name:
return ('renderer_processes' in name and
not _IGNORED_MEMORY_STATS_RE.search(name))
# TODO(crbug.com/610962): Remove this stopgap when the perf dashboard
# is able to cope with the data load generated by TBMv2 metrics.
if 'memory:chrome' in name:
return ('renderer_processes' in name and
not _IGNORED_MEMORY_STATS_RE.search(name))
if 'v8-gc' in name:
return (_V8_GC_HIGH_LEVEL_STATS_RE.search(name) and
not _IGNORED_V8_STATS_RE.search(name))
# Allow all other metrics.
return True
return V8BrowsingShouldAddValue(name)
@benchmark.Info(emails=['mythria@chromium.org','ulan@chromium.org'])
......
# Copyright 2018 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 benchmarks import loading
from contrib.cluster_telemetry import ct_benchmarks_util
from contrib.cluster_telemetry import page_set
from telemetry.page import cache_temperature as cache_temperature_module
from telemetry.page import traffic_setting
# pylint: disable=protected-access
class _LoadingBaseClusterTelemetry(loading._LoadingBase):
""" A base class for cluster telemetry loading benchmarks. """
options = {'upload_results': True}
_ALL_NET_CONFIGS = traffic_setting.NETWORK_CONFIGS.keys()
_ALL_CACHE_TEMPERATURES = cache_temperature_module.ALL_CACHE_TEMPERATURES
@classmethod
def AddBenchmarkCommandLineArgs(cls, parser):
super(_LoadingBaseClusterTelemetry, cls).AddBenchmarkCommandLineArgs(parser)
ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser)
parser.add_option(
'--wait-time', action='store', type='int',
default=60, help='Number of seconds to wait for after navigation.')
parser.add_option(
'--traffic-setting', choices=cls._ALL_NET_CONFIGS,
default=traffic_setting.REGULAR_4G,
help='Traffic condition (string). Default to "%%default". Can be: %s' %
', '.join(cls._ALL_NET_CONFIGS))
parser.add_option(
'--cache-temperature', choices=cls._ALL_CACHE_TEMPERATURES,
default=cache_temperature_module.COLD,
help='Cache temperature (string). Default to "%%default". Can be: %s' %
', '.join(cls._ALL_CACHE_TEMPERATURES))
def CreateStorySet(self, options):
def Wait(action_runner):
action_runner.Wait(options.wait_time)
return page_set.CTPageSet(
options.urls_list, options.user_agent, options.archive_data_file,
traffic_setting=options.traffic_setting,
cache_temperature=options.cache_temperature,
run_page_interaction_callback=Wait)
# Copyright 2016 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 benchmarks import loading
from contrib.cluster_telemetry import ct_benchmarks_util
from contrib.cluster_telemetry import page_set
from telemetry.page import cache_temperature as cache_temperature_module
from telemetry.page import traffic_setting
from contrib.cluster_telemetry import loading_base_ct
# pylint: disable=protected-access
class LoadingClusterTelemetry(loading._LoadingBase):
options = {'upload_results': True}
_ALL_NET_CONFIGS = traffic_setting.NETWORK_CONFIGS.keys()
_ALL_CACHE_TEMPERATURES = cache_temperature_module.ALL_CACHE_TEMPERATURES
@classmethod
def AddBenchmarkCommandLineArgs(cls, parser):
super(LoadingClusterTelemetry, cls).AddBenchmarkCommandLineArgs(parser)
ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser)
parser.add_option(
'--wait-time', action='store', type='int',
default=60, help='Number of seconds to wait for after navigation.')
parser.add_option(
'--traffic-setting', choices=cls._ALL_NET_CONFIGS,
default=traffic_setting.REGULAR_4G,
help='Traffic condition (string). Default to "%%default". Can be: %s' %
', '.join(cls._ALL_NET_CONFIGS))
parser.add_option(
'--cache-temperature', choices=cls._ALL_CACHE_TEMPERATURES,
default=cache_temperature_module.COLD,
help='Cache temperature (string). Default to "%%default". Can be: %s' %
', '.join(cls._ALL_CACHE_TEMPERATURES))
def CreateStorySet(self, options):
def Wait(action_runner):
action_runner.Wait(options.wait_time)
return page_set.CTPageSet(
options.urls_list, options.user_agent, options.archive_data_file,
traffic_setting=options.traffic_setting,
cache_temperature=options.cache_temperature,
run_page_interaction_callback=Wait)
class LoadingClusterTelemetry(loading_base_ct._LoadingBaseClusterTelemetry):
@classmethod
def Name(cls):
......
# Copyright 2018 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 benchmarks import v8_browsing
from contrib.cluster_telemetry import loading_base_ct
from telemetry.web_perf import timeline_based_measurement
# pylint: disable=protected-access
class V8LoadingClusterTelemetry(loading_base_ct._LoadingBaseClusterTelemetry):
@classmethod
def AddBenchmarkCommandLineArgs(cls, parser):
super(V8LoadingClusterTelemetry, cls).AddBenchmarkCommandLineArgs(parser)
parser.add_option('--enable-rcs', action='store_true', default=False,
help='Enable expensive V8 Runtime Call Stats metrics.')
@classmethod
def ShouldAddValue(cls, name, from_first_story_run):
del from_first_story_run # unused
return v8_browsing.V8BrowsingShouldAddValue(name)
@classmethod
def Name(cls):
return 'v8.loading.cluster_telemetry'
def CreateCoreTimelineBasedMeasurementOptions(self):
options = timeline_based_measurement.Options()
v8_browsing.AugmentOptionsForV8BrowsingMetrics(options,
enable_runtime_call_stats=options.enable_rcs)
return options
......@@ -27,6 +27,7 @@ def GetAllStorySets():
'rasterize_and_record_micro_ct',
'multipage_skpicture_printer_ct',
'loading.cluster_telemetry',
'v8.loading.cluster_telemetry',
'memory.cluster_telemetry',
'skpicture_printer',
'cros_tab_switching.typical_24',
......
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