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

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

Issue 1410683014: [tools/perf] Add dummy benchmark that produces Gaussian value with a known mean and std (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_page.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
7 meant to represent any actual performance data of the browser.
8 """
9
10 import random
11
12 from core import perf_benchmark
13
14 from telemetry.value import scalar
15 from telemetry.page import page_test
16
17 import page_sets
18
19
20 class _DummyTest(page_test.PageTest):
21 def __init__(self, avg, std):
22 super(_DummyTest, self).__init__()
23 self._avg = avg
24 self._std = std
25
26 def ValidateAndMeasurePage(self, page, tab, results):
27 results.AddValue(scalar.ScalarValue(
28 page=page,
29 name='gaussian-value', units='ms',
30 value=random.gauss(self._avg, self._std),
31 description=('Random number that follows the Gaussian distribution '
32 'with mean=%s and std=%s' % (self._avg, self._std))))
33
34
35 class _DummyBenchmark(perf_benchmark.PerfBenchmark):
36 page_set = page_sets.DummyStorySet
37
38
39 class DummyBenchmarkOne(_DummyBenchmark):
40 """ A low noise benchmark with mean=100 & std=1. """
41
42 def CreatePageTest(self, options):
43 return _DummyTest(100, 1)
44
45 @classmethod
46 def Name(cls):
47 return 'dummy_benchmark.stable_benchmark_1'
48
49
50 class DummyBenchmarkTwo(_DummyBenchmark):
51 """ A noisy benchmark with mean=50 & std=20. """
52
53 def CreatePageTest(self, options):
54 return _DummyTest(50, 20)
55
56 @classmethod
57 def Name(cls):
58 return 'dummy_benchmark.noisy_benchmark_1'
OLDNEW
« no previous file with comments | « no previous file | tools/perf/page_sets/dummy_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698