Merge lp://qastaging/~kalebral-deactivatedaccount/drizzle-automation/bench-config-name into lp://qastaging/drizzle-automation
- bench-config-name
- Merge into trunk
Proposed by
Lee Bieber
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp://qastaging/~kalebral-deactivatedaccount/drizzle-automation/bench-config-name |
Merge into: | lp://qastaging/drizzle-automation |
Diff against target: |
1008 lines (+226/-213) 17 files modified
drizzle/automation/config/automation.cnf (+2/-44) drizzle/automation/config/dbt2/dbt2.cnf (+16/-0) drizzle/automation/config/drizzleslap/drizzleslap.cnf (+29/-0) drizzle/automation/config/sqlbench/sqlbench.cnf (+4/-0) drizzle/automation/dbt2/run.py (+12/-9) drizzle/automation/drizzleslap/run.py (+10/-7) drizzle/automation/lib/options.py (+21/-24) drizzle/automation/lib/util.py (+46/-6) drizzle/automation/reports/__init__.py (+1/-1) drizzle/automation/reports/dbt2.py (+11/-11) drizzle/automation/reports/drizzleslap.py (+3/-3) drizzle/automation/reports/run.py (+18/-19) drizzle/automation/reports/sqlbench.py (+3/-3) drizzle/automation/reports/sysbench.py (+12/-12) drizzle/automation/runner.py (+1/-1) drizzle/automation/sqlbench/run.py (+10/-7) drizzle/automation/sysbench/run.py (+27/-66) |
To merge this branch: | bzr merge lp://qastaging/~kalebral-deactivatedaccount/drizzle-automation/bench-config-name |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Automatons | Pending | ||
Review via email: mp+16988@code.qastaging.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Lee Bieber (kalebral-deactivatedaccount) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'drizzle/automation/config/automation.cnf' |
2 | --- drizzle/automation/config/automation.cnf 2010-01-04 18:23:17 +0000 |
3 | +++ drizzle/automation/config/automation.cnf 2010-01-11 06:21:15 +0000 |
4 | @@ -40,52 +40,14 @@ |
5 | rsync_dir= drizzle.org:web/doxygen/ |
6 | |
7 | [dbt2] |
8 | -dbt2_config_name= dbt2 |
9 | -# location of the dbt2 code |
10 | -dbt2_home= /home/drizzle/repos/dbt2-0.40 |
11 | -# location of generated data |
12 | -dbt2_data_dir= /home/drizzle/repos/dbt2-0.40/data |
13 | -# number of data warehouses |
14 | -dbt2_warehouses= 10 |
15 | -# number of connections |
16 | -dbt2_connections= 2,4,8,16,32,64,128,256,512,1024 |
17 | -# time to run the tests |
18 | -dbt2_time= 300 |
19 | + |
20 | # Email recipients to receive a text regression report on completion of a run. Comma separated. |
21 | report_email= drizzle-benchmark@lists.launchpad.net |
22 | |
23 | [drizzleslap] |
24 | -drizzleslap_config_name= drizzleslap |
25 | -common_options= --number-int-cols=2 --number-char-cols=3 --auto-generate-sql |
26 | -concurrency= 1,100,200,300,400,500,600,700,800,900,1000,1100,1200 |
27 | -engine= innodb |
28 | -iterations= 10 |
29 | +# Email recipients to receive a text regression report on completion of a run. Comma separated. |
30 | report_email= drizzle-benchmark@lists.launchpad.net |
31 | |
32 | -[drizzleslap_tests] |
33 | -guid= --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --number-of-queries=100000 --engine=innodb |
34 | -guid-scale= --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --engine=innodb |
35 | -key= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --number-of-queries=100000 --engine=innodb |
36 | -key-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=1000 --engine=innodb |
37 | -mixed= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=100000 --engine=innodb |
38 | -mixed-commit= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=100000 --commit=8 --engine=innodb |
39 | -mixed-commit-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --auto-generate-sql-execute-number=1000 --commit=8 --engine=innodb |
40 | -mixed-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --auto-generate-sql-execute-number=1000 --engine=innodb |
41 | -scan= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read --number-of-queries=100000 --engine=innodb |
42 | -scan-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read --auto-generate-sql-execute-number=1000 --engine=innodb |
43 | -update= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --number-of-queries=100000 --auto-generate-sql-write-number=50000 --engine=innodb |
44 | -update-commit= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --number-of-queries=100000 --auto-generate-sql-write-number=50000 --commit=8 --engine=innodb |
45 | -update-commit-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=1000 --auto-generate-sql-write-number=50000 --commit=8 --engine=innodb |
46 | -update-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=1000 --auto-generate-sql-write-number=50000 --engine=innodb |
47 | -write= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000 --engine=innodb |
48 | -write-commit= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000 --commit=8 --engine=innodb |
49 | -write-commit-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --commit=8 --engine=innodb |
50 | -write-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --engine=innodb |
51 | -write_bh= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000 --engine=blackhole |
52 | -write-scale_bh= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --engine=blackhole |
53 | -guid_bh= --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --number-of-queries=100000 --engine=blackhole |
54 | -guid-scale_bh= --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --engine=blackhole |
55 | - |
56 | [lcov] |
57 | |
58 | # Directories queried during GCOV/LCOV code coverage |
59 | @@ -115,10 +77,6 @@ |
60 | |
61 | [sqlbench] |
62 | |
63 | -# configuration name for use in sysbench_config table |
64 | -sqlbench_config_name= sqlbench |
65 | -# location of the sql bench repository |
66 | -sqlbench_home= /home/drizzle/repos/sql-bench |
67 | # Email recipients to receive a text regression report on completion of |
68 | # a sqlbench run. Comma separated. |
69 | report_email= drizzle-benchmark@lists.launchpad.net |
70 | |
71 | === added directory 'drizzle/automation/config/dbt2' |
72 | === added file 'drizzle/automation/config/dbt2/dbt2.cnf' |
73 | --- drizzle/automation/config/dbt2/dbt2.cnf 1970-01-01 00:00:00 +0000 |
74 | +++ drizzle/automation/config/dbt2/dbt2.cnf 2010-01-11 06:21:15 +0000 |
75 | @@ -0,0 +1,16 @@ |
76 | +[run] |
77 | + |
78 | +# location of the dbt2 code |
79 | +dbt2_home= /home/drizzle/repos/dbt2 |
80 | + |
81 | +# location of generated data |
82 | +dbt2_data_dir= /home/drizzle/repos/dbt2/data_dir |
83 | + |
84 | +# number of data warehouses |
85 | +dbt2_warehouses= 10 |
86 | + |
87 | +# number of connections |
88 | +dbt2_connections= 2,4,8,16,32,64,128,256,512,1024 |
89 | + |
90 | +# time to run the tests |
91 | +dbt2_time= 300 |
92 | |
93 | === added directory 'drizzle/automation/config/drizzleslap' |
94 | === added file 'drizzle/automation/config/drizzleslap/drizzleslap.cnf' |
95 | --- drizzle/automation/config/drizzleslap/drizzleslap.cnf 1970-01-01 00:00:00 +0000 |
96 | +++ drizzle/automation/config/drizzleslap/drizzleslap.cnf 2010-01-11 06:21:15 +0000 |
97 | @@ -0,0 +1,29 @@ |
98 | +[run] |
99 | +common_options= --number-int-cols=2 --number-char-cols=3 --auto-generate-sql |
100 | +concurrency= 1,100,200,300,400,500,600,700,800,900,1000,1100,1200 |
101 | +engine= innodb |
102 | +iterations= 10 |
103 | + |
104 | +[drizzleslap_tests] |
105 | +guid= --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --number-of-queries=100000 --engine=innodb |
106 | +guid-scale= --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --engine=innodb |
107 | +key= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --number-of-queries=100000 --engine=innodb |
108 | +key-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --auto-generate-sql-execute-number=1000 --engine=innodb |
109 | +mixed= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=100000 --engine=innodb |
110 | +mixed-commit= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --number-of-queries=100000 --commit=8 --engine=innodb |
111 | +mixed-commit-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --auto-generate-sql-execute-number=1000 --commit=8 --engine=innodb |
112 | +mixed-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --auto-generate-sql-execute-number=1000 --engine=innodb |
113 | +scan= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read --number-of-queries=100000 --engine=innodb |
114 | +scan-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=read --auto-generate-sql-execute-number=1000 --engine=innodb |
115 | +update= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --number-of-queries=100000 --auto-generate-sql-write-number=50000 --engine=innodb |
116 | +update-commit= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --number-of-queries=100000 --auto-generate-sql-write-number=50000 --commit=8 --engine=innodb |
117 | +update-commit-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=1000 --auto-generate-sql-write-number=50000 --commit=8 --engine=innodb |
118 | +update-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=1000 --auto-generate-sql-write-number=50000 --engine=innodb |
119 | +write= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000 --engine=innodb |
120 | +write-commit= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000 --commit=8 --engine=innodb |
121 | +write-commit-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --commit=8 --engine=innodb |
122 | +write-scale= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --engine=innodb |
123 | +write_bh= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --number-of-queries=100000 --engine=blackhole |
124 | +write-scale_bh= --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --engine=blackhole |
125 | +guid_bh= --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --number-of-queries=100000 --engine=blackhole |
126 | +guid-scale_bh= --auto-generate-sql-guid-primary --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000 --engine=blackhole |
127 | |
128 | === added directory 'drizzle/automation/config/sqlbench' |
129 | === added file 'drizzle/automation/config/sqlbench/sqlbench.cnf' |
130 | --- drizzle/automation/config/sqlbench/sqlbench.cnf 1970-01-01 00:00:00 +0000 |
131 | +++ drizzle/automation/config/sqlbench/sqlbench.cnf 2010-01-11 06:21:15 +0000 |
132 | @@ -0,0 +1,4 @@ |
133 | +[run] |
134 | + |
135 | +# location of the sql bench repository |
136 | +sqlbench_home= /home/drizzle/repos/sql-bench |
137 | |
138 | === modified file 'drizzle/automation/dbt2/run.py' |
139 | --- drizzle/automation/dbt2/run.py 2009-12-22 21:04:47 +0000 |
140 | +++ drizzle/automation/dbt2/run.py 2010-01-11 06:21:15 +0000 |
141 | @@ -83,7 +83,7 @@ |
142 | working_dir= variables['working_dir'] |
143 | server_name= variables['server'] |
144 | run_date= datetime.datetime.now().isoformat() |
145 | - config_name= variables['dbt2']['dbt2_config_name'] |
146 | + bench_config_name= variables['bench_config_name'] |
147 | |
148 | os.chdir(working_dir) |
149 | |
150 | @@ -157,13 +157,16 @@ |
151 | util.get_profile_options(server,variables['profiler']) |
152 | |
153 | run_id= util.getNextRunId() |
154 | - config_id= util.getConfigId(config_name) |
155 | + config_id= util.getConfigId(bench_config_name) |
156 | |
157 | + # load the configuration file |
158 | + dbt2_config_variables= util.loadConfigFile("dbt2", bench_config_name) |
159 | + |
160 | # location of dbt2 tools and scripts |
161 | - dbt2_home= variables['dbt2']['dbt2_home'] |
162 | + dbt2_home= dbt2_config_variables['run']['dbt2_home'] |
163 | bzr_revision= variables['bzr_revision'] |
164 | - test_time= variables['dbt2']['dbt2_time'] |
165 | - warehouses= variables['dbt2']['dbt2_warehouses'] |
166 | + test_time= dbt2_config_variables['run']['dbt2_time'] |
167 | + warehouses= dbt2_config_variables['run']['dbt2_warehouses'] |
168 | |
169 | # location where test results are stored |
170 | output_dirname= ('dbt2-%s' % (bzr_revision)) |
171 | @@ -172,7 +175,7 @@ |
172 | os.mkdir(output_dirname) |
173 | |
174 | # load data into database |
175 | - cmd= "%s/scripts/drizzle/drizzle_load_db.sh --path %s --verbose --drizzle_path %s" % (dbt2_home, variables['dbt2']['dbt2_data_dir'], os.path.join(working_dir, 'client/drizzle')) |
176 | + cmd= "%s/bin/drizzle/dbt2-drizzle-load-db --path %s --verbose --drizzle_path %s" % (dbt2_home, dbt2_config_variables['run']['dbt2_data_dir'], os.path.join(working_dir, 'client/drizzle')) |
177 | logging.info("Loading data.... ") |
178 | logging.info("%s " % cmd) |
179 | (retcode, output)= commands.getstatusoutput(cmd) |
180 | @@ -181,11 +184,11 @@ |
181 | sys.exit(1) |
182 | |
183 | # get list of connections to run with |
184 | - connection_levels= [int(x) for x in variables['dbt2']['dbt2_connections'].split(",")] |
185 | + connection_levels= [int(x) for x in dbt2_config_variables['run']['dbt2_connections'].split(",")] |
186 | |
187 | # run the tests |
188 | for connections in connection_levels: |
189 | - cmd= "%s/scripts/drizzle/drizzle_run.sh --connections %d --time %d --warehouses %d --verbose --output-base %s --run-number %s" % (dbt2_home, connections, int(test_time), int(warehouses), output_dirname, connections) |
190 | + cmd= "%s/bin/drizzle/dbt2-drizzle-run --connections %d --time %d --warehouses %d --verbose --output-base %s --run-number %s" % (dbt2_home, connections, int(test_time), int(warehouses), output_dirname, connections) |
191 | logging.info("Running %s " % cmd) |
192 | (retcode, output)= commands.getstatusoutput(cmd) |
193 | if not retcode == 0: |
194 | @@ -207,7 +210,7 @@ |
195 | # send email report |
196 | if variables['with_email_report'] is True: |
197 | import drizzle.automation.reports.dbt2 as reports |
198 | - email_text= reports.getDbt2Report(working_dir, config_name, run_id, run_date, server_name, variables['bzr_branch'], bzr_revision) |
199 | + email_text= reports.getDbt2Report(working_dir, bench_config_name, run_id, run_date, server_name, variables['bzr_branch'], bzr_revision) |
200 | logging.info("Sending email...") |
201 | # bug https://bugs.launchpad.net/launchpad/+bug/419562 - need to use registered launchpad name for from |
202 | #from_string= ('%s <drizzle-benchmark@lists.launchpad.net>' % socket.gethostname()) |
203 | |
204 | === modified file 'drizzle/automation/drizzleslap/run.py' |
205 | --- drizzle/automation/drizzleslap/run.py 2009-12-08 19:39:50 +0000 |
206 | +++ drizzle/automation/drizzleslap/run.py 2010-01-11 06:21:15 +0000 |
207 | @@ -100,7 +100,7 @@ |
208 | working_dir= variables['working_dir'] |
209 | server_name= variables['server'] |
210 | run_date= datetime.datetime.now().isoformat() |
211 | - config_name= variables['drizzleslap']['drizzleslap_config_name'] |
212 | + bench_config_name= variables['bench_config_name'] |
213 | |
214 | os.chdir(working_dir) |
215 | |
216 | @@ -170,17 +170,20 @@ |
217 | sys.exit(1) |
218 | |
219 | run_id= util.getNextRunId() |
220 | - config_id= util.getConfigId(config_name) |
221 | + config_id= util.getConfigId(bench_config_name) |
222 | + |
223 | + # load the configuration file |
224 | + drizzleslap_config_variables= util.loadConfigFile("drizzleslap", bench_config_name) |
225 | |
226 | # get the list of tests that are specified |
227 | # in the configuration file in the drizzleslap_tests section |
228 | - list_of_tests= variables['drizzleslap_tests'] |
229 | + list_of_tests= drizzleslap_config_variables['drizzleslap_tests'] |
230 | |
231 | # csv file name includes the bzr version number /tmp/drizzleslap-1172.csv |
232 | csv_file= ("/tmp/drizzleslap-%s.csv" % (variables['bzr_revision'])) |
233 | - common_options= variables['drizzleslap']['common_options'] |
234 | - concurrency = variables['drizzleslap']['concurrency'] |
235 | - iterations= variables['drizzleslap']['iterations'] |
236 | + common_options= drizzleslap_config_variables['run']['common_options'] |
237 | + concurrency = drizzleslap_config_variables['run']['concurrency'] |
238 | + iterations= drizzleslap_config_variables['run']['iterations'] |
239 | |
240 | # remove csv file to start fresh |
241 | if os.path.exists(csv_file): |
242 | @@ -229,7 +232,7 @@ |
243 | # send email report |
244 | if variables['with_email_report'] is True: |
245 | import drizzle.automation.reports.drizzleslap as reports |
246 | - email_text= reports.getDrizzleslapReport(working_dir, config_name, run_id, run_date, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
247 | + email_text= reports.getDrizzleslapReport(working_dir, bench_config_name, run_id, run_date, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
248 | logging.info("Sending email...") |
249 | # bug https://bugs.launchpad.net/launchpad/+bug/419562 - need to use registered launchpad name for from |
250 | #from_string= ('%s <drizzle-benchmark@lists.launchpad.net>' % socket.gethostname()) |
251 | |
252 | === modified file 'drizzle/automation/lib/options.py' |
253 | --- drizzle/automation/lib/options.py 2009-12-22 21:04:47 +0000 |
254 | +++ drizzle/automation/lib/options.py 2010-01-11 06:21:15 +0000 |
255 | @@ -68,6 +68,10 @@ |
256 | |
257 | # Add non-grouped options... |
258 | parser.add_option( |
259 | + "--bench-config-name" |
260 | + , help="DBT2/DRIZZLESLAP/SYSBENCH/SQLBENCH command only. Sets the bench configuration to use." |
261 | + ) |
262 | +parser.add_option( |
263 | "--dry-run" |
264 | , action="store_true" |
265 | , default= False |
266 | @@ -144,7 +148,7 @@ |
267 | "--with-email-report" |
268 | , action="store_true" |
269 | , default= False |
270 | - , help="DBT2/DRIZZLESLAP/SQLBENCH/SYSBENCH/REPORT command only. Sends a text report to those recipients in [dbt2][sqlbench][sysbench][drizzleslap][report_email] configuration variable." |
271 | + , help="DBT2/DRIZZLESLAP/SQLBENCH/SYSBENCH REPORT command. Sends a text report to those recipients in [dbt2][sqlbench][sysbench][drizzleslap][report_email] configuration variable." |
272 | ) |
273 | parser.add_option( |
274 | "--with-show-status" |
275 | @@ -196,14 +200,6 @@ |
276 | ) |
277 | parser.add_option_group(group) |
278 | |
279 | -# Add all the SYSBENCH-COMMAND-specific options |
280 | -group= optparse.OptionGroup(parser, "Options when running the SYSBENCH command") |
281 | - |
282 | -group.add_option( |
283 | - "--sysbench-config" |
284 | - , help="SYSBENCH command only. Sets the bench configuration to run." |
285 | - ) |
286 | -parser.add_option_group(group) |
287 | |
288 | # Add all the MySQL Sandbox-mode-specific options |
289 | group= optparse.OptionGroup(parser, "Options when running reports") |
290 | @@ -367,19 +363,20 @@ |
291 | os.environ['LD_PRELOAD']= variables['ld_preload'] |
292 | logging.info("LD_PRELOAD is set to %s\n" % variables['ld_preload']) |
293 | |
294 | - # For benchmarks with sysbench, we require that a configuration file |
295 | - # for the sysbench options is supplied at runtime... |
296 | - if variables['command'] == 'sysbench': |
297 | - # Check to ensure we have a sysbench_config value... |
298 | - bench_config= supplied.sysbench_config |
299 | - if bench_config is None: |
300 | - logging.error("The --sysbench-config CLI option is required when running the BENCH command. Exiting.") |
301 | + # For dbt2, drizzleslap, sqlbench and sysbench, we require that |
302 | + # a configuration file with options is supplied at runtime... |
303 | + command_to_run= variables['command'] |
304 | + if command_to_run in ['dbt2','drizzleslap','sqlbench','sysbench']: |
305 | + # Check to ensure we have a bench_config value... |
306 | + bench_config_name= supplied.bench_config_name |
307 | + if bench_config_name is None: |
308 | + logging.error("The --bench-config-name CLI option is required when running the %s command. Exiting." % command_to_run) |
309 | sys.exit(1) |
310 | else: |
311 | - variables['sysbench_config']= bench_config |
312 | + variables['bench_config_name']= bench_config_name |
313 | |
314 | # Ensure reports have a report name specified |
315 | - if variables['command'] == 'report': |
316 | + if command_to_run == 'report': |
317 | report_name= supplied.report_name |
318 | if report_name is None: |
319 | logging.error("The --report-name CLI option is required when running the REPORT command. Exiting.") |
320 | @@ -387,14 +384,14 @@ |
321 | else: |
322 | variables['report_name']= report_name |
323 | |
324 | - # Check to ensure we have a sysbench_config value for the sysbench report |
325 | - if report_name == 'sysbench': |
326 | - bench_config= supplied.sysbench_config |
327 | - if bench_config is None: |
328 | - logging.error("The --sysbench-config CLI option is required when running the BENCH command. Exiting.") |
329 | + # Check to ensure we have a bench_config value for the specified report |
330 | + if report_name in ['dbt2','drizzleslap','sqlbench','sysbench']: |
331 | + bench_config_name= supplied.bench_config_name |
332 | + if bench_config_name is None: |
333 | + logging.error("The --bench-config CLI option is required when running the %s command. Exiting." % command_to_run) |
334 | sys.exit(1) |
335 | else: |
336 | - variables['sysbench_config']= bench_config |
337 | + variables['bench_config_name']= bench_config_name |
338 | |
339 | return variables |
340 | |
341 | |
342 | === modified file 'drizzle/automation/lib/util.py' |
343 | --- drizzle/automation/lib/util.py 2009-12-17 17:18:18 +0000 |
344 | +++ drizzle/automation/lib/util.py 2010-01-11 06:21:15 +0000 |
345 | @@ -27,6 +27,7 @@ |
346 | """Just some useful functions""" |
347 | |
348 | import textwrap |
349 | +import os |
350 | import types |
351 | from drizzle.automation.lib import logging |
352 | from drizzle.automation.lib import db |
353 | @@ -86,7 +87,7 @@ |
354 | |
355 | db.execute_sql(sql) |
356 | |
357 | -def getConfigId(config_name): |
358 | +def getConfigId(bench_config_name): |
359 | """Returns the integer ID of the configuration name used in this run.""" |
360 | |
361 | # If we have not already done so, we query the local DB for the ID |
362 | @@ -94,16 +95,16 @@ |
363 | # a new record in the sysbench_config table and return the newly generated |
364 | # identifier. |
365 | |
366 | - sql= "SELECT config_id FROM sysbench_config WHERE name = '%s'" % config_name |
367 | + sql= "SELECT config_id FROM sysbench_config WHERE name = '%s'" % bench_config_name |
368 | |
369 | from drizzle.automation.lib import db |
370 | result= db.get_select(sql) |
371 | |
372 | if len(result) == 0: |
373 | # Insert a new record for this config and return the new ID... |
374 | - sql= "INSERT INTO sysbench_config (config_id, name) VALUES (NULL, '%s')" % config_name |
375 | + sql= "INSERT INTO sysbench_config (config_id, name) VALUES (NULL, '%s')" % bench_config_name |
376 | db.execute_sql(sql) |
377 | - return getConfigId(config_name) |
378 | + return getConfigId(bench_config_name) |
379 | else: |
380 | config_id= int(result[0][0]) |
381 | |
382 | @@ -124,7 +125,7 @@ |
383 | return new_run_id |
384 | |
385 | # Find the specific last run_id which corresponds to the revision and branch ... |
386 | -def getLastRunId(config_name, server_name, bzr_branch, bzr_revision): |
387 | +def getLastRunId(bench_config_name, server_name, bzr_branch, bzr_revision): |
388 | |
389 | version= bzr_branch + '-' + str(bzr_revision) |
390 | |
391 | @@ -139,7 +140,7 @@ |
392 | ORDER BY run_id DESC |
393 | LIMIT 1 |
394 | """ % ( |
395 | - config_name |
396 | + bench_config_name |
397 | , server_name |
398 | , version |
399 | ) |
400 | @@ -170,3 +171,42 @@ |
401 | server.setProfiler(profiler) |
402 | server.start() |
403 | |
404 | +# Finds and parses the configuration file for the supplied config name |
405 | +# A configuration file containing benchmark program and server |
406 | +# parameters is required. If the --bench-config=NAME is a relative |
407 | +# filename, we search in /etc/drizzle-automation/sysbench/ for a |
408 | +# file called NAME.cnf |
409 | +def loadConfigFile(benchmark_name, bench_config_name): |
410 | + |
411 | + logging.info("Loading configuration for config name %s." % bench_config_name) |
412 | + bench_config_variables= {} |
413 | + |
414 | + locations=[] |
415 | + bench_config_file= bench_config_name |
416 | + if not bench_config_file.endswith(".cnf"): |
417 | + bench_config_file= bench_config_file + ".cnf" |
418 | + |
419 | + if not bench_config_file.startswith(os.path.sep): |
420 | + # Assume all relative config files are in /etc/drizzle-automation/sysbench/ |
421 | + locations.append(os.path.join(os.path.sep, "etc", "drizzle-automation", benchmark_name, bench_config_file)) |
422 | + locations.append(os.path.expanduser(os.path.join("~", ".drizzle-automation", benchmark_name, bench_config_file))) |
423 | + else: |
424 | + locations.append(bench_config_file) |
425 | + |
426 | + bench_config_file_found=False |
427 | + for test_bench_config_file in locations: |
428 | + if os.path.exists(test_bench_config_file): |
429 | + bench_config_file_found=True |
430 | + if not bench_config_file_found: |
431 | + logging.error("Specified configuration file not found: \"%s\". Exiting." % bench_config_file) |
432 | + sys.exit(1) |
433 | + |
434 | + import ConfigParser |
435 | + parser= ConfigParser.RawConfigParser() |
436 | + parser.read(locations) |
437 | + for sec in parser.sections(): |
438 | + bench_config_variables[sec]= {} |
439 | + for k,v in parser.items(sec): |
440 | + bench_config_variables[sec][k]= v |
441 | + |
442 | + return bench_config_variables |
443 | |
444 | === modified file 'drizzle/automation/reports/__init__.py' |
445 | --- drizzle/automation/reports/__init__.py 2009-11-16 21:25:20 +0000 |
446 | +++ drizzle/automation/reports/__init__.py 2010-01-11 06:21:15 +0000 |
447 | @@ -27,4 +27,4 @@ |
448 | |
449 | __copyright__= "Copyright 2009 Sun Microsystems" |
450 | |
451 | -__all__= ['sysbench','sqlbench','drizzleslap','run'] |
452 | +__all__= ['dbt2', 'drizzleslap', 'sqlbench','sysbench','run'] |
453 | |
454 | === modified file 'drizzle/automation/reports/dbt2.py' |
455 | --- drizzle/automation/reports/dbt2.py 2010-01-05 16:27:22 +0000 |
456 | +++ drizzle/automation/reports/dbt2.py 2010-01-11 06:21:15 +0000 |
457 | @@ -38,11 +38,11 @@ |
458 | i.connections |
459 | , ROUND(AVG(i.tpm),2) AS tpm |
460 | , IF (AVG(i.tpm) >= agg.avg_tpm |
461 | - , CONCAT('-', ROUND(((AVG(i.tpm) - agg.avg_tpm) / agg.avg_tpm) * 100, 2), '%%') |
462 | - , CONCAT('+', ROUND(((agg.avg_tpm- AVG(i.tpm)) / agg.avg_tpm) * 100, 2), '%%') |
463 | + , CONCAT('+', ROUND(((AVG(i.tpm) - agg.avg_tpm) / agg.avg_tpm) * 100, 2), '%%') |
464 | + , CONCAT('-', ROUND(((agg.avg_tpm - AVG(i.tpm)) / agg.avg_tpm) * 100, 2), '%%') |
465 | ) as pct_diff_from_avg |
466 | -, ROUND(agg.avg_tpm- (AVG(i.tpm)), 2) AS diff_from_avg |
467 | -, IF(ABS(agg.avg_tpm- AVG(i.tpm)) <= agg.stddev_tpm |
468 | +, ROUND((AVG(i.tpm) - agg.avg_tpm), 2) AS diff_from_avg |
469 | +, IF(ABS(AVG(i.tpm) - agg.avg_tpm) <= agg.stddev_tpm |
470 | , 'within norms' |
471 | , 'outside norms' |
472 | ) as is_normal |
473 | @@ -97,7 +97,7 @@ |
474 | """ |
475 | return report_text |
476 | |
477 | -def getDbt2Report(working_dir, dbt2_config_name, run_id, run_date, server_name, bzr_branch, bzr_revision): |
478 | +def getDbt2Report(working_dir, bench_config_name, run_id, run_date, server_name, bzr_branch, bzr_revision): |
479 | """Returns a textual report of the regression over a series of runs""" |
480 | |
481 | # Find the revision comment from BZR |
482 | @@ -135,7 +135,7 @@ |
483 | ORDER BY run_id DESC |
484 | LIMIT 20 |
485 | """ % ( |
486 | - dbt2_config_name |
487 | + bench_config_name |
488 | , server_name |
489 | , bzr_branch |
490 | , run_id |
491 | @@ -189,11 +189,11 @@ |
492 | i.connections |
493 | , ROUND(AVG(i.tpm),2) AS tpm |
494 | , IF (AVG(i.tpm) >= agg.avg_tpm |
495 | - , CONCAT('-', ROUND(((AVG(i.tpm) - agg.avg_tpm) / agg.avg_tpm) * 100, 2), '%%') |
496 | - , CONCAT('+', ROUND(((agg.avg_tpm- AVG(i.tpm)) / agg.avg_tpm) * 100, 2), '%%') |
497 | + , CONCAT('+', ROUND(((AVG(i.tpm) - agg.avg_tpm) / agg.avg_tpm) * 100, 2), '%%') |
498 | + , CONCAT('-', ROUND(((agg.avg_tpm- AVG(i.tpm)) / agg.avg_tpm) * 100, 2), '%%') |
499 | ) as pct_diff_from_avg |
500 | -, ROUND((agg.avg_tpm- AVG(i.tpm)), 2) AS diff_from_avg |
501 | -, IF(ABS(agg.avg_tpm- AVG(i.tpm)) <= agg.stddev_tpm |
502 | +, ROUND((AVG(i.tpm) - agg.avg_tpm), 2) AS diff_from_avg |
503 | +, IF(ABS(AVG(i.tpm) - agg.avg_tpm) <= agg.stddev_tpm |
504 | , 'within norms' |
505 | , 'outside norms' |
506 | ) as is_normal |
507 | @@ -224,7 +224,7 @@ |
508 | GROUP BY i.connections |
509 | ORDER BY i.connections |
510 | """ % ( |
511 | - dbt2_config_name |
512 | + bench_config_name |
513 | , server_name |
514 | , bzr_branch |
515 | , run_id |
516 | |
517 | === modified file 'drizzle/automation/reports/drizzleslap.py' |
518 | --- drizzle/automation/reports/drizzleslap.py 2009-12-08 19:39:50 +0000 |
519 | +++ drizzle/automation/reports/drizzleslap.py 2010-01-11 06:21:15 +0000 |
520 | @@ -99,7 +99,7 @@ |
521 | |
522 | return report_text |
523 | |
524 | -def getDrizzleslapReport(working_dir, drizzleslap_config_name, run_id, run_date, server_name, bzr_branch, bzr_revision): |
525 | +def getDrizzleslapReport(working_dir, bench_config_name, run_id, run_date, server_name, bzr_branch, bzr_revision): |
526 | """Returns a textual report of the results over a series of runs""" |
527 | |
528 | # Find the revision comment from BZR |
529 | @@ -139,7 +139,7 @@ |
530 | ORDER BY run_id DESC |
531 | LIMIT 20 |
532 | """ % ( |
533 | - drizzleslap_config_name |
534 | + bench_config_name |
535 | , server_name |
536 | , bzr_branch |
537 | , run_id |
538 | @@ -228,7 +228,7 @@ |
539 | GROUP BY i.engine_name, i.test_name, i.concurrency |
540 | ORDER BY i.engine_name, i.test_name, i.concurrency |
541 | """ % ( |
542 | - drizzleslap_config_name |
543 | + bench_config_name |
544 | , server_name |
545 | , bzr_branch |
546 | , run_id |
547 | |
548 | === modified file 'drizzle/automation/reports/run.py' |
549 | --- drizzle/automation/reports/run.py 2009-12-22 21:04:47 +0000 |
550 | +++ drizzle/automation/reports/run.py 2010-01-11 06:21:15 +0000 |
551 | @@ -59,13 +59,12 @@ |
552 | logging.error("The report option requires the --bzr-revision, --bzr-branch CLI options to be supplied. Exiting.") |
553 | return False |
554 | |
555 | - if report_name == 'sysbench': |
556 | - # For sysbench We need a config file, a server, a revision, and a branch |
557 | - try: |
558 | - sysbench_config= variables['sysbench_config'] |
559 | - except KeyError: |
560 | - logging.error("The sysbench report requires the --sysbench-config, --bzr-revision, --bzr-branch CLI options to be supplied. Exiting.") |
561 | - return False |
562 | + # For reports, we need a config file, a server, a revision, and a branch |
563 | + try: |
564 | + bench_config_name= variables['bench_config_name'] |
565 | + except KeyError: |
566 | + logging.error("The %s report requires the --bench-config-name, --bzr-revision, --bzr-branch CLI options to be supplied. Exiting." % report_name) |
567 | + return False |
568 | |
569 | try: |
570 | server_name= variables['server'] |
571 | @@ -74,62 +73,62 @@ |
572 | |
573 | if report_name == 'sysbench': |
574 | import drizzle.automation.reports.sysbench as reports |
575 | - run_id= util.getLastRunId(variables['sysbench_config'], server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
576 | + run_id= util.getLastRunId(bench_config_name, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
577 | if run_id is None: |
578 | logging.error("Could not find the last run ID for config %s, server %s, branch %s at revision %s. Exiting." |
579 | % ( |
580 | - sysbench_config_name |
581 | + bench_config_name |
582 | , server_name |
583 | , variables['bzr_branch'] |
584 | , variables['bzr_revision'] |
585 | )) |
586 | sys.exit(1) |
587 | - report_text= reports.getSysbenchRegressionReportForRunId(run_id, sysbench_config, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
588 | + report_text= reports.getSysbenchRegressionReportForRunId(run_id, bench_config_name, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
589 | email_or_display_report(variables['with_email_report'], variables['sysbench']['report_email'], 'SYSBENCH', report_text, bzr_revision, run_id) |
590 | |
591 | elif report_name == 'sqlbench': |
592 | import drizzle.automation.reports.sqlbench as reports |
593 | - run_id= util.getLastRunId(variables['sqlbench']['sqlbench_config_name'], server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
594 | + run_id= util.getLastRunId(bench_config_name, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
595 | if run_id is None: |
596 | logging.error("Could not find the last run ID for config %s, server %s, branch %s at revision %s. Exiting." |
597 | % ( |
598 | - variables['sqlbench']['sqlbench_config_name'] |
599 | + bench_config_name |
600 | , server_name |
601 | , variables['bzr_branch'] |
602 | , variables['bzr_revision'] |
603 | )) |
604 | sys.exit(1) |
605 | - report_text= reports.getSqlbenchReport(None, variables['sqlbench']['sqlbench_config_name'], run_id, 'N/A', server_name, variables['bzr_branch'], int(variables['bzr_revision']), variables['engine']) |
606 | + report_text= reports.getSqlbenchReport(None, bench_config_name, run_id, 'N/A', server_name, variables['bzr_branch'], int(variables['bzr_revision']), variables['engine']) |
607 | email_or_display_report(variables['with_email_report'], variables['sqlbench']['report_email'], 'SQLBENCH', report_text, bzr_revision, run_id) |
608 | |
609 | elif report_name == 'drizzleslap': |
610 | import drizzle.automation.reports.drizzleslap as reports |
611 | - run_id= util.getLastRunId(variables['drizzleslap']['drizzleslap_config_name'], server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
612 | + run_id= util.getLastRunId(bench_config_name, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
613 | if run_id is None: |
614 | logging.error("Could not find the last run ID for config %s, server %s, branch %s at revision %s. Exiting." |
615 | % ( |
616 | - variables['drizzleslap']['drizzleslap_config_name'] |
617 | + bench_config_name |
618 | , server_name |
619 | , variables['bzr_branch'] |
620 | , variables['bzr_revision'] |
621 | )) |
622 | sys.exit(1) |
623 | - report_text= reports.getDrizzleslapReport(None, variables['drizzleslap']['drizzleslap_config_name'], run_id, 'N/A', server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
624 | + report_text= reports.getDrizzleslapReport(None, bench_config_name, run_id, 'N/A', server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
625 | email_or_display_report(variables['with_email_report'], variables['drizzleslap']['report_email'], 'DRIZZLESLAP', report_text, bzr_revision, run_id) |
626 | |
627 | elif report_name == 'dbt2': |
628 | import drizzle.automation.reports.dbt2 as reports |
629 | - run_id= util.getLastRunId(variables['dbt2']['dbt2_config_name'], server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
630 | + run_id= util.getLastRunId(bench_config_name, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
631 | if run_id is None: |
632 | logging.error("Could not find the last run ID for config %s, server %s, branch %s at revision %s. Exiting." |
633 | % ( |
634 | - variables['dbt2']['dbt2_config_name'] |
635 | + bench_config_name |
636 | , server_name |
637 | , variables['bzr_branch'] |
638 | , variables['bzr_revision'] |
639 | )) |
640 | sys.exit(1) |
641 | - report_text= reports.getDbt2Report(None, variables['dbt2']['dbt2_config_name'], run_id, 'N/A', server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
642 | + report_text= reports.getDbt2Report(None, bench_config_name, run_id, 'N/A', server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
643 | email_or_display_report(variables['with_email_report'], variables['dbt2']['report_email'], 'DBT2', report_text, bzr_revision, run_id) |
644 | |
645 | else: |
646 | |
647 | === modified file 'drizzle/automation/reports/sqlbench.py' |
648 | --- drizzle/automation/reports/sqlbench.py 2009-12-22 21:04:47 +0000 |
649 | +++ drizzle/automation/reports/sqlbench.py 2010-01-11 06:21:15 +0000 |
650 | @@ -98,7 +98,7 @@ |
651 | """ |
652 | return report_text |
653 | |
654 | -def getSqlbenchReport(working_dir, sqlbench_config_name, run_id, run_date, server_name, bzr_branch, bzr_revision, storage_engine): |
655 | +def getSqlbenchReport(working_dir, bench_config_name, run_id, run_date, server_name, bzr_branch, bzr_revision, storage_engine): |
656 | """Returns a textual report of the regression over a series of runs""" |
657 | |
658 | # Find the revision comment from BZR |
659 | @@ -136,7 +136,7 @@ |
660 | ORDER BY run_id DESC |
661 | LIMIT 20 |
662 | """ % ( |
663 | - sqlbench_config_name |
664 | + bench_config_name |
665 | , server_name |
666 | , bzr_branch |
667 | , run_id |
668 | @@ -228,7 +228,7 @@ |
669 | GROUP BY i.engine, i.operation_name |
670 | ORDER BY i.engine, i.operation_name |
671 | """ % ( |
672 | - sqlbench_config_name |
673 | + bench_config_name |
674 | , server_name |
675 | , bzr_branch |
676 | , run_id |
677 | |
678 | === modified file 'drizzle/automation/reports/sysbench.py' |
679 | --- drizzle/automation/reports/sysbench.py 2009-11-23 19:16:20 +0000 |
680 | +++ drizzle/automation/reports/sysbench.py 2010-01-11 06:21:15 +0000 |
681 | @@ -30,7 +30,7 @@ |
682 | import socket |
683 | import commands |
684 | |
685 | -def get5and20RevisionRanges(sysbench_config, server_name, bzr_branch, run_id): |
686 | +def get5and20RevisionRanges(bench_config_name, server_name, bzr_branch, run_id): |
687 | """Return a tuple with 2 ranges of run_id values for the last 5 and 20 runs""" |
688 | sql= """ |
689 | SELECT |
690 | @@ -44,7 +44,7 @@ |
691 | ORDER BY run_id DESC |
692 | LIMIT 20 |
693 | """ % ( |
694 | - sysbench_config |
695 | + bench_config_name |
696 | , server_name |
697 | , bzr_branch |
698 | , run_id |
699 | @@ -105,7 +105,7 @@ |
700 | ) |
701 | return db.get_select(sql) |
702 | |
703 | -def getAllRegressionForBranchAndConfig(sysbench_config, server_name, bzr_branch, run_id): |
704 | +def getAllRegressionForBranchAndConfig(bench_config_name, server_name, bzr_branch, run_id): |
705 | sql= """ |
706 | SELECT |
707 | i.concurrency |
708 | @@ -146,7 +146,7 @@ |
709 | GROUP BY i.concurrency |
710 | ORDER BY i.concurrency |
711 | """ % ( |
712 | - sysbench_config |
713 | + bench_config_name |
714 | , server_name |
715 | , bzr_branch |
716 | , run_id |
717 | @@ -154,10 +154,10 @@ |
718 | |
719 | return db.get_select(sql) |
720 | |
721 | -def getSysbenchRegressionReportForRunId(run_id, sysbench_config, server_name, bzr_branch, bzr_revision): |
722 | +def getSysbenchRegressionReportForRunId(run_id, bench_config_name, server_name, bzr_branch, bzr_revision): |
723 | """Returns a textual report of the regression over a series of runs given a supplied run ID""" |
724 | |
725 | - (last_5_revs, last_20_revs)= get5and20RevisionRanges(sysbench_config, server_name, bzr_branch, run_id) |
726 | + (last_5_revs, last_20_revs)= get5and20RevisionRanges(bench_config_name, server_name, bzr_branch, run_id) |
727 | |
728 | report_text= """========================================================================================================= |
729 | REGRESSION REPORT |
730 | @@ -175,7 +175,7 @@ |
731 | """ % ( |
732 | socket.gethostname() |
733 | , run_id |
734 | - , sysbench_config |
735 | + , bench_config_name |
736 | , server_name |
737 | , bzr_branch |
738 | , int(bzr_revision) |
739 | @@ -214,14 +214,14 @@ |
740 | ========================================================================================================= |
741 | """ |
742 | |
743 | - results= getAllRegressionForBranchAndConfig(sysbench_config, server_name, bzr_branch, run_id) |
744 | + results= getAllRegressionForBranchAndConfig(bench_config_name, server_name, bzr_branch, run_id) |
745 | for result in results: |
746 | report_text= report_text + "%-6s %9s %15s %10s %14s %10s %10s %10s %10s\n" % tuple(result) |
747 | report_text= report_text + "=========================================================================================================" |
748 | |
749 | return report_text |
750 | |
751 | -def getSysbenchRegressionReport(working_dir, sysbench_config, run_id, run_date, server_name, bzr_branch, bzr_revision): |
752 | +def getSysbenchRegressionReport(working_dir, bench_config_name, run_id, run_date, server_name, bzr_branch, bzr_revision): |
753 | """Returns a textual report of the regression over a series of runs""" |
754 | |
755 | # Find the revision comment from BZR |
756 | @@ -243,7 +243,7 @@ |
757 | else: |
758 | full_commentary= None |
759 | |
760 | - (last_5_revs, last_20_revs)= get5and20RevisionRanges(sysbench_config, server_name, bzr_branch, run_id) |
761 | + (last_5_revs, last_20_revs)= get5and20RevisionRanges(bench_config_name, server_name, bzr_branch, run_id) |
762 | |
763 | report_text= """========================================================================================================= |
764 | REGRESSION REPORT |
765 | @@ -263,7 +263,7 @@ |
766 | socket.gethostname() |
767 | , run_id |
768 | , run_date |
769 | - , sysbench_config |
770 | + , bench_config_name |
771 | , server_name |
772 | , bzr_branch |
773 | , int(bzr_revision) |
774 | @@ -301,7 +301,7 @@ |
775 | ========================================================================================================= |
776 | """ |
777 | |
778 | - results= getAllRegressionForBranchAndConfig(sysbench_config, server_name, bzr_branch, run_id) |
779 | + results= getAllRegressionForBranchAndConfig(bench_config_name, server_name, bzr_branch, run_id) |
780 | for result in results: |
781 | report_text= report_text + "%-6s %9s %15s %10s %14s %10s %10s %10s %10s\n" % tuple(result) |
782 | report_text= report_text + "=========================================================================================================" |
783 | |
784 | === modified file 'drizzle/automation/runner.py' |
785 | --- drizzle/automation/runner.py 2009-12-22 21:04:47 +0000 |
786 | +++ drizzle/automation/runner.py 2010-01-11 06:21:15 +0000 |
787 | @@ -49,7 +49,7 @@ |
788 | If we wanted to run the "sysbench" command against this branch for revisions |
789 | r930 through r932, we could call the drizzle-automation script like so: |
790 | |
791 | - $> drizzle-automation --sysbench-config=some_benchmark_config --bzr-branch=trunk --r930..932 sysbench |
792 | + $> drizzle-automation --bench-config=some_benchmark_config --bzr-branch=trunk --r930..932 sysbench |
793 | |
794 | This would create 3 sandboxes: |
795 | |
796 | |
797 | === modified file 'drizzle/automation/sqlbench/run.py' |
798 | --- drizzle/automation/sqlbench/run.py 2009-12-22 21:04:47 +0000 |
799 | +++ drizzle/automation/sqlbench/run.py 2010-01-11 06:21:15 +0000 |
800 | @@ -86,11 +86,8 @@ |
801 | working_dir= variables['working_dir'] |
802 | run_date= datetime.datetime.now().isoformat() |
803 | server_name= variables['server'] |
804 | - # need the location where the sqlbench repository is located |
805 | - sqlbench_home= variables['sqlbench']['sqlbench_home'] |
806 | - # the name of the script to run |
807 | - # sqlbench_config_name is set to "sqlbench" for now |
808 | - sqlbench_config_name= variables['sqlbench']['sqlbench_config_name'] |
809 | + # name of the configuration file to use |
810 | + bench_config_name= variables['bench_config_name'] |
811 | os.chdir(working_dir) |
812 | |
813 | # For BZR mode, the "version" of the server (used in identifying the |
814 | @@ -160,7 +157,13 @@ |
815 | sys.exit(1) |
816 | |
817 | run_id= util.getNextRunId() |
818 | - config_id= util.getConfigId(sqlbench_config_name) |
819 | + config_id= util.getConfigId(bench_config_name) |
820 | + |
821 | + # load the configuration file |
822 | + sqlbench_config_variables= util.loadConfigFile("sqlbench", bench_config_name) |
823 | + |
824 | + # need the location where the sqlbench repository is located |
825 | + sqlbench_home= sqlbench_config_variables['run']['sqlbench_home'] |
826 | |
827 | try: |
828 | storage_engine= variables['engine'] |
829 | @@ -197,7 +200,7 @@ |
830 | # send email report |
831 | if variables['with_email_report'] is True: |
832 | import drizzle.automation.reports.sqlbench as reports |
833 | - email_text= reports.getSqlbenchReport(working_dir, sqlbench_config_name, run_id, run_date, server_name, variables['bzr_branch'], int(variables['bzr_revision']), storage_engine) |
834 | + email_text= reports.getSqlbenchReport(working_dir, bench_config_name, run_id, run_date, server_name, variables['bzr_branch'], int(variables['bzr_revision']), storage_engine) |
835 | logging.info("Sending email...") |
836 | # bug https://bugs.launchpad.net/launchpad/+bug/419562 - need to use registered launchpad name for from |
837 | #from_string= ('%s <drizzle-benchmark@lists.launchpad.net>' % socket.gethostname()) |
838 | |
839 | === modified file 'drizzle/automation/sysbench/run.py' |
840 | --- drizzle/automation/sysbench/run.py 2009-12-17 17:18:18 +0000 |
841 | +++ drizzle/automation/sysbench/run.py 2010-01-11 06:21:15 +0000 |
842 | @@ -59,7 +59,7 @@ |
843 | , concurrency |
844 | , variable_name |
845 | , value |
846 | - ) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d)""" % (server_version, sysbench_config, run_date, int(concurrency), name, value) |
847 | + ) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d)""" % (server_version, bench_config_name, run_date, int(concurrency), name, value) |
848 | db.execute_sql(sql) |
849 | except: |
850 | continue |
851 | @@ -118,80 +118,35 @@ |
852 | |
853 | class Sysbench: |
854 | |
855 | - def __init__(self, config_name, server_name, server_port): |
856 | + def __init__(self, bench_config_name, server_name, server_port): |
857 | self._bench_cmd= "sysbench" |
858 | - self._config_name= config_name |
859 | + self._bench_config_name= bench_config_name |
860 | self._config_id= None |
861 | self._server_name= server_name |
862 | self._server_port= server_port |
863 | - self.loadConfigFile() |
864 | - |
865 | - def loadConfigFile(self): |
866 | - """Finds and parses the configuration file for the supplied config name""" |
867 | - # A configuration file containing benchmark program and server |
868 | - # parameters is required. If the --sysbench-config=NAME is a relative |
869 | - # filename, we search in /etc/drizzle-automation/sysbench/ for a |
870 | - # file called NAME.cnf |
871 | - |
872 | - logging.info("Loading sysbench configuration for config name %s." % self._config_name) |
873 | - sysbench_variables= {} # This is what we return to the caller |
874 | - |
875 | - locations=[] |
876 | - config_file= self._config_name |
877 | - if not config_file.endswith(".cnf"): |
878 | - config_file= config_file + ".cnf" |
879 | - |
880 | - if not config_file.startswith(os.path.sep): |
881 | - # Assume all relative config files are in /etc/drizzle-automation/sysbench/ |
882 | - locations.append(os.path.join(os.path.sep, "etc", "drizzle-automation", "sysbench", config_file)) |
883 | - locations.append(os.path.expanduser(os.path.join("~", ".drizzle-automation", "sysbench", config_file))) |
884 | - else: |
885 | - locations.append(config_file) |
886 | - |
887 | - config_file_found=False |
888 | - for test_config_file in locations: |
889 | - if os.path.exists(test_config_file): |
890 | - config_file_found=True |
891 | - if not config_file_found: |
892 | - logging.error("Specified sysbench configuration file not found: \"%s\". Exiting." % config_file) |
893 | - sys.exit(1) |
894 | - |
895 | - import ConfigParser |
896 | - parser= ConfigParser.RawConfigParser() |
897 | - parser.read(locations) |
898 | - for sec in parser.sections(): |
899 | - sysbench_variables[sec]= {} |
900 | - for k,v in parser.items(sec): |
901 | - sysbench_variables[sec][k]= v |
902 | - |
903 | - self._config_variables= sysbench_variables |
904 | - self.setRunOptions(sysbench_variables['sysbench']) |
905 | - |
906 | - if 'build' in sysbench_variables.keys(): |
907 | - self.setBuildOptions(sysbench_variables['build']) |
908 | - |
909 | - def getConcurrencyLevels(self): |
910 | + |
911 | + def getConcurrencyLevels(self, sysbench_config_variables, bench_config_name): |
912 | """Returns a sequence of concurrency levels this sysbench will run""" |
913 | try: |
914 | - concurrency_levels= [int(x) for x in self._config_variables['run']['concurrency'].split(",")] |
915 | + concurrency_levels= [int(x) for x in sysbench_config_variables['run']['concurrency'].split(",")] |
916 | return concurrency_levels |
917 | except KeyError: |
918 | - logging.error("concurrency is required in configuration section [run] for %s. Exiting." % self._config_name) |
919 | + logging.error("concurrency is required in configuration section [run] for %s. Exiting." % bench_config_name) |
920 | sys.exit(1) |
921 | |
922 | - def getIterations(self): |
923 | + def getIterations(self, sysbench_config_variables, bench_config_name): |
924 | """Returns the number of iterations this sysbench will run""" |
925 | try: |
926 | - iterations= int(self._config_variables['run']['iterations']) |
927 | + iterations= int(sysbench_config_variables['run']['iterations']) |
928 | return iterations |
929 | except KeyError: |
930 | - logging.error("iterations is required in configuration section [run] for %s. Exiting." % self._config_name) |
931 | + logging.error("iterations is required in configuration section [run] for %s. Exiting." % bench_config_name) |
932 | sys.exit(1) |
933 | |
934 | - def getServerOptions(self, server_name): |
935 | + def getServerOptions(self, sysbench_config_variables, server_name): |
936 | """Returns a dictionary of server-specific options loaded from sysbench config file""" |
937 | - if server_name in self._config_variables.keys(): |
938 | - return self._config_variables[server_name] |
939 | + if server_name in sysbench_config_variables.keys(): |
940 | + return sysbench_config_variables[server_name] |
941 | else: |
942 | logging.warning("Did not find any variables in sysbench config file for server section %s" % server_name) |
943 | return {} |
944 | @@ -303,7 +258,7 @@ |
945 | # we are benchmarking. |
946 | |
947 | working_dir= variables['working_dir'] |
948 | - sysbench_config= variables['sysbench_config'] |
949 | + bench_config_name= variables['bench_config_name'] |
950 | run_date= datetime.datetime.now().isoformat() |
951 | |
952 | server_name= variables['server'] |
953 | @@ -350,7 +305,13 @@ |
954 | client= client_adapter(variables['working_dir'], server.getPort()) |
955 | |
956 | # Initialize sysbench runner instance and load config file |
957 | - sysbench= Sysbench(sysbench_config, server_name, server.getPort()) |
958 | + sysbench= Sysbench(bench_config_name, server_name, server.getPort()) |
959 | + |
960 | + sysbench_config_variables= util.loadConfigFile("sysbench", bench_config_name) |
961 | + sysbench.setRunOptions(sysbench_config_variables['sysbench']) |
962 | + |
963 | + if 'build' in sysbench_config_variables.keys(): |
964 | + sysbench.setBuildOptions(sysbench_config_variables['build']) |
965 | |
966 | # The sysbench configuration file can specify configure and make options |
967 | # which is why we delay building until this point, which is after the |
968 | @@ -364,7 +325,7 @@ |
969 | builder.build(variables['force_build']) |
970 | |
971 | # Set the startup options of the server from the sysbench configuration file |
972 | - server.setStartOptions(sysbench.getServerOptions(server_name)) |
973 | + server.setStartOptions(sysbench.getServerOptions(sysbench_config_variables, server_name)) |
974 | |
975 | server.stopAll() |
976 | |
977 | @@ -385,10 +346,10 @@ |
978 | # under the profiler now that the database is prepared |
979 | util.get_profile_options(server,variables['profiler']) |
980 | |
981 | - concurrency_levels= sysbench.getConcurrencyLevels() |
982 | - iterations= sysbench.getIterations() |
983 | + concurrency_levels= sysbench.getConcurrencyLevels(sysbench_config_variables, bench_config_name) |
984 | + iterations= sysbench.getIterations(sysbench_config_variables, bench_config_name) |
985 | run_id= util.getNextRunId() |
986 | - config_id= util.getConfigId(sysbench_config) |
987 | + config_id= util.getConfigId(bench_config_name) |
988 | |
989 | # Run the benchmarks for the specified config |
990 | for concurrency in concurrency_levels: |
991 | @@ -398,7 +359,7 @@ |
992 | logging.warning("Server not running. Re-starting...") |
993 | server.start() |
994 | |
995 | - logging.info("Running sysbench config %s for concurrency at %d - iteration %d." % (sysbench_config, concurrency, iteration)) |
996 | + logging.info("Running sysbench config %s for concurrency at %d - iteration %d." % (bench_config_name, concurrency, iteration)) |
997 | |
998 | result= sysbench.run(concurrency) |
999 | |
1000 | @@ -431,7 +392,7 @@ |
1001 | |
1002 | if variables['with_email_report'] is True: |
1003 | import drizzle.automation.reports.sysbench as reports |
1004 | - email_text= reports.getSysbenchRegressionReport(working_dir, sysbench_config, run_id, run_date, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
1005 | + email_text= reports.getSysbenchRegressionReport(working_dir, bench_config_name, run_id, run_date, server_name, variables['bzr_branch'], int(variables['bzr_revision'])) |
1006 | # bug https://bugs.launchpad.net/launchpad/+bug/419562 - need to use registered launchpad name for from |
1007 | #from_string= ('%s <drizzle-benchmark@lists.launchpad.net>' % socket.gethostname()) |
1008 | from_string= ('%s <eday@oddments.org>' % socket.gethostname()) |
change -sysbench-config option to -bench-config-name to be generic for all benchmarks. Drizzleslap, dbt2 and sqlbench now require this option and a configuration file.
Note still need to change sysbench to use the util.loadConfigFile and rename the table sysbench_config to be bench_config. That will be phase 2 after this initial change is approved and merged