OLD | NEW |
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 """Dummy benchmarks for the bisect FYI integration tests. | 4 """Dummy benchmarks for the bisect FYI integration tests. |
5 | 5 |
6 The number they produce aren't meant to represent any actual performance | 6 The number they produce aren't meant to represent any actual performance |
7 data of the browser. For more information about these dummy benchmarks, | 7 data of the browser. For more information about these dummy benchmarks, |
8 see: https://goo.gl/WvZiiW | 8 see: https://goo.gl/WvZiiW |
9 """ | 9 """ |
10 | 10 |
11 import random | 11 import random |
12 | 12 |
13 from core import perf_benchmark | 13 from core import perf_benchmark |
14 | 14 |
15 from telemetry.value import scalar | 15 from telemetry.value import scalar |
16 from telemetry.page import page_test | 16 from telemetry.page import legacy_page_test |
17 | 17 |
18 from page_sets import dummy_story_set | 18 from page_sets import dummy_story_set |
19 | 19 |
20 | 20 |
21 class _DummyTest(page_test.PageTest): | 21 class _DummyTest(legacy_page_test.LegacyPageTest): |
22 | 22 |
23 def __init__(self, avg, std): | 23 def __init__(self, avg, std): |
24 super(_DummyTest, self).__init__() | 24 super(_DummyTest, self).__init__() |
25 self._avg = avg | 25 self._avg = avg |
26 self._std = std | 26 self._std = std |
27 | 27 |
28 def ValidateAndMeasurePage(self, page, tab, results): | 28 def ValidateAndMeasurePage(self, page, tab, results): |
29 results.AddValue(scalar.ScalarValue( | 29 results.AddValue(scalar.ScalarValue( |
30 page=page, | 30 page=page, |
31 name='gaussian-value', units='ms', | 31 name='gaussian-value', units='ms', |
(...skipping 19 matching lines...) Expand all Loading... |
51 | 51 |
52 class DummyBenchmarkTwo(_DummyBenchmark): | 52 class DummyBenchmarkTwo(_DummyBenchmark): |
53 """A noisy benchmark with mean=50 & std=20.""" | 53 """A noisy benchmark with mean=50 & std=20.""" |
54 | 54 |
55 def CreatePageTest(self, options): | 55 def CreatePageTest(self, options): |
56 return _DummyTest(50, 20) | 56 return _DummyTest(50, 20) |
57 | 57 |
58 @classmethod | 58 @classmethod |
59 def Name(cls): | 59 def Name(cls): |
60 return 'dummy_benchmark.noisy_benchmark_1' | 60 return 'dummy_benchmark.noisy_benchmark_1' |
OLD | NEW |