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

Side by Side Diff: tools/perf/benchmarks/memory_benchmark.py

Issue 1266833004: telemetry: Add a page set for blink's memory usage measurement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disabled Created 5 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import re
6
7 from core import perf_benchmark
8
9 from telemetry.timeline import tracing_category_filter
10 from telemetry.web_perf import timeline_based_measurement
11
12 import page_sets
13
14
15 class _MemoryBenchmark(perf_benchmark.PerfBenchmark):
16 """Base class for timeline based memory benchmarks."""
17
18 def SetExtraBrowserOptions(self, options):
19 # TODO(perezju): Temporary workaround to disable periodic memory dumps.
20 # See: http://crbug.com/513692
21 options.AppendExtraBrowserArgs('--enable-memory-benchmarking')
22
23 def CreateTimelineBasedMeasurementOptions(self):
24 # Enable only memory-infra, to get memory dumps, and blink.console, to get
25 # the timeline markers used for mapping threads to tabs.
26 trace_memory = tracing_category_filter.TracingCategoryFilter(
27 filter_string='-*,blink.console,disabled-by-default-memory-infra')
28 return timeline_based_measurement.Options(overhead_level=trace_memory)
29
30
31 class MemoryHealthPlan(_MemoryBenchmark):
32 """Timeline based benchmark for the Memory Health Plan."""
33
34 _RE_BENCHMARK_VALUES = re.compile('(fore|back)ground-memory_')
35
36 page_set = page_sets.MemoryHealthStory
37
38 @classmethod
39 def Name(cls):
40 return 'memory.memory_health_plan'
41
42 @classmethod
43 def ValueCanBeAddedPredicate(cls, value, is_first_result):
44 return bool(cls._RE_BENCHMARK_VALUES.match(value.name))
45
46
47 class RendererMemoryBlinkMemoryMobile(_MemoryBenchmark):
48 """Timeline based benchmark for measuring memory consumption on mobile
49 sites on which blink's memory consumption is relatively high."""
50
51 _RE_RENDERER_VALUES = re.compile('.+-memory_.+_renderer')
52
53 page_set = page_sets.BlinkMemoryMobilePageSet
54
55 def SetExtraBrowserOptions(self, options):
56 super(RendererMemoryBlinkMemoryMobile, self).SetExtraBrowserOptions(
57 options)
58 options.AppendExtraBrowserArgs([
59 # TODO(bashi): Temporary workaround for http://crbug.com/461788
60 '--no-sandbox',
61 # Ignore certs errors because record_wpr cannot handle certs correctly
62 # in some cases (e.g. WordPress).
63 '--ignore-certificate-errors',
64 ])
65
66 @classmethod
67 def Name(cls):
68 return 'memory.blink_memory_mobile'
69
70 @classmethod
71 def ValueCanBeAddedPredicate(cls, value, is_first_result):
72 return bool(cls._RE_RENDERER_VALUES.match(value.name))
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/benchmark_smoke_unittest.py ('k') | tools/perf/benchmarks/memory_health_plan.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698