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