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

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

Issue 1439453002: [tools/perf] Add a broken page to dummy_benchmark.noisy_benchmark_1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | tools/perf/page_sets/dummy_story_set.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 """ 4 """
5 Benchmarks in this file is created for the purpose of testing telemetry 5 Benchmarks in this file is created for the purpose of testing telemetry
6 integration with perf dashboard and bisect bot. The number they produce aren't 6 integration with perf dashboard and bisect bot. The number they produce aren't
7 meant to represent any actual performance data of the browser. 7 meant to represent any actual performance data of the browser.
8 """ 8 """
9 9
10 import random 10 import random
11 11
12 from core import perf_benchmark 12 from core import perf_benchmark
13 13
14 from telemetry.value import scalar 14 from telemetry.value import scalar
15 from telemetry.page import page_test 15 from telemetry.page import page_test
16 16
17 import page_sets 17 from page_sets import dummy_story_set
18 18
19 19
20 class _DummyTest(page_test.PageTest): 20 class _DummyTest(page_test.PageTest):
21 def __init__(self, avg, std): 21 def __init__(self, avg, std):
22 super(_DummyTest, self).__init__() 22 super(_DummyTest, self).__init__()
23 self._avg = avg 23 self._avg = avg
24 self._std = std 24 self._std = std
25 25
26 def ValidateAndMeasurePage(self, page, tab, results): 26 def ValidateAndMeasurePage(self, page, tab, results):
27 results.AddValue(scalar.ScalarValue( 27 results.AddValue(scalar.ScalarValue(
28 page=page, 28 page=page,
29 name='gaussian-value', units='ms', 29 name='gaussian-value', units='ms',
30 value=random.gauss(self._avg, self._std), 30 value=random.gauss(self._avg, self._std),
31 description=('Random number that follows the Gaussian distribution ' 31 description=('Random number that follows the Gaussian distribution '
32 'with mean=%s and std=%s' % (self._avg, self._std)))) 32 'with mean=%s and std=%s' % (self._avg, self._std))))
33 33
34 34
35 class _DummyBenchmark(perf_benchmark.PerfBenchmark): 35 class _DummyBenchmark(perf_benchmark.PerfBenchmark):
36 page_set = page_sets.DummyStorySet 36 page_set = dummy_story_set.DummyStorySet
37 37
38 38
39 class DummyBenchmarkOne(_DummyBenchmark): 39 class DummyBenchmarkOne(_DummyBenchmark):
40 """ A low noise benchmark with mean=100 & std=1. """ 40 """ A low noise benchmark with mean=100 & std=1. """
41 41
42 def CreatePageTest(self, options): 42 def CreatePageTest(self, options):
43 return _DummyTest(100, 1) 43 return _DummyTest(100, 1)
44 44
45 @classmethod 45 @classmethod
46 def Name(cls): 46 def Name(cls):
47 return 'dummy_benchmark.stable_benchmark_1' 47 return 'dummy_benchmark.stable_benchmark_1'
48 48
49 49
50 class DummyBenchmarkTwo(_DummyBenchmark): 50 class DummyBenchmarkTwo(_DummyBenchmark):
51 """ A noisy benchmark with mean=50 & std=20. """ 51 """ A noisy benchmark with mean=50 & std=20. """
52 52
53 def CreatePageTest(self, options): 53 def CreatePageTest(self, options):
54 return _DummyTest(50, 20) 54 return _DummyTest(50, 20)
55 55
56 @classmethod 56 @classmethod
57 def Name(cls): 57 def Name(cls):
58 return 'dummy_benchmark.noisy_benchmark_1' 58 return 'dummy_benchmark.noisy_benchmark_1'
59
60 def CreateStorySet(self, options):
61 del options # unused
62 story_set = dummy_story_set.DummyStorySet()
63 story_set.AddStory(dummy_story_set.BrokenDummyPage(story_set))
64 return story_set
OLDNEW
« no previous file with comments | « no previous file | tools/perf/page_sets/dummy_story_set.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698