aboutsummaryrefslogtreecommitdiff
path: root/crosperf/mock_instance.py
blob: 4271d8fd42ffe3b0edaf18d91971d97234f928f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# -*- coding: utf-8 -*-
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""This contains some mock instances for testing."""

from __future__ import print_function

from benchmark import Benchmark
from label import MockLabel

perf_args = 'record -a -e cycles'
label1 = MockLabel(
    'test1',
    'build1',
    'image1',
    'autotest_dir',
    'debug_dir',
    '/tmp/test_benchmark_run',
    'x86-alex',
    'chromeos-alex1',
    image_args='',
    cache_dir='',
    cache_only=False,
    log_level='average',
    compiler='gcc',
    skylab=False,
    chrome_src=None)

label2 = MockLabel(
    'test2',
    'build2',
    'image2',
    'autotest_dir',
    'debug_dir',
    '/tmp/test_benchmark_run_2',
    'x86-alex',
    'chromeos-alex2',
    image_args='',
    cache_dir='',
    cache_only=False,
    log_level='average',
    compiler='gcc',
    skylab=False,
    chrome_src=None)

benchmark1 = Benchmark('benchmark1', 'autotest_name_1', 'autotest_args', 2, '',
                       perf_args, '', '')

benchmark2 = Benchmark('benchmark2', 'autotest_name_2', 'autotest_args', 2, '',
                       perf_args, '', '')

keyval = {}
keyval[0] = {
    '': 'PASS',
    'milliseconds_1': '1',
    'milliseconds_2': '8',
    'milliseconds_3': '9.2',
    'test{1}': '2',
    'test{2}': '4',
    'ms_1': '2.1',
    'total': '5',
    'bool': 'True'
}

keyval[1] = {
    '': 'PASS',
    'milliseconds_1': '3',
    'milliseconds_2': '5',
    'ms_1': '2.2',
    'total': '6',
    'test{1}': '3',
    'test{2}': '4',
    'bool': 'FALSE'
}

keyval[2] = {
    '': 'PASS',
    'milliseconds_4': '30',
    'milliseconds_5': '50',
    'ms_1': '2.23',
    'total': '6',
    'test{1}': '5',
    'test{2}': '4',
    'bool': 'FALSE'
}

keyval[3] = {
    '': 'PASS',
    'milliseconds_1': '3',
    'milliseconds_6': '7',
    'ms_1': '2.3',
    'total': '7',
    'test{1}': '2',
    'test{2}': '6',
    'bool': 'FALSE'
}

keyval[4] = {
    '': 'PASS',
    'milliseconds_1': '3',
    'milliseconds_8': '6',
    'ms_1': '2.3',
    'total': '7',
    'test{1}': '2',
    'test{2}': '6',
    'bool': 'TRUE'
}

keyval[5] = {
    '': 'PASS',
    'milliseconds_1': '3',
    'milliseconds_8': '6',
    'ms_1': '2.2',
    'total': '7',
    'test{1}': '2',
    'test{2}': '2',
    'bool': 'TRUE'
}

keyval[6] = {
    '': 'PASS',
    'milliseconds_1': '3',
    'milliseconds_8': '6',
    'ms_1': '2',
    'total': '7',
    'test{1}': '2',
    'test{2}': '4',
    'bool': 'TRUE'
}

keyval[7] = {
    '': 'PASS',
    'milliseconds_1': '3',
    'milliseconds_8': '6',
    'ms_1': '1',
    'total': '7',
    'test{1}': '1',
    'test{2}': '6',
    'bool': 'TRUE'
}

keyval[8] = {
    '': 'PASS',
    'milliseconds_1': '3',
    'milliseconds_8': '6',
    'ms_1': '3.3',
    'total': '7',
    'test{1}': '2',
    'test{2}': '8',
    'bool': 'TRUE'
}