Merge lp:~kalebral-deactivatedaccount/drizzle-automation/drizzleslap-stddev into lp:drizzle-automation

Proposed by Lee Bieber
Status: Merged
Merged at revision: not available
Proposed branch: lp:~kalebral-deactivatedaccount/drizzle-automation/drizzleslap-stddev
Merge into: lp:drizzle-automation
Diff against target: 314 lines (+153/-68)
5 files modified
drizzle/automation/drizzleslap/run.py (+1/-1)
drizzle/automation/reports/drizzleslap.py (+150/-60)
drizzle/automation/reports/sqlbench.py (+0/-2)
drizzle/automation/reports/sysbench.py (+0/-4)
drizzle/automation/server/drizzled.py (+2/-1)
To merge this branch: bzr merge lp:~kalebral-deactivatedaccount/drizzle-automation/drizzleslap-stddev
Reviewer Review Type Date Requested Status
Drizzle Automatons Pending
Review via email: mp+14854@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lee Bieber (kalebral-deactivatedaccount) wrote :

changes to support reporting standard deviation for drizzleslap

107. By lbieber <lbieber@orisndriz01>

add -drizzle-protocol-port and --mysql-protocol-port options so we can start drizzled

108. By lbieber <lbieber@orisndriz01>

queries were incorrect, need to select test_name as well as concurrency

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzle/automation/drizzleslap/run.py'
2--- drizzle/automation/drizzleslap/run.py 2009-11-04 22:42:07 +0000
3+++ drizzle/automation/drizzleslap/run.py 2009-11-16 06:16:09 +0000
4@@ -230,7 +230,7 @@
5 # send email report
6 if variables['with_email_report'] is True:
7 import drizzle.automation.reports.drizzleslap as reports
8- email_text= reports.getDrizzleslapReport(working_dir, run_id, run_date, server_name, variables['bzr_branch'], int(variables['bzr_revision']))
9+ email_text= reports.getDrizzleslapReport(working_dir, config_name, run_id, run_date, server_name, variables['bzr_branch'], int(variables['bzr_revision']))
10 logging.info("Sending email...")
11 from_string= ('%s <eday@oddments.org>' % socket.gethostname())
12 util.mail(from_string, variables['drizzleslap']['report_email'], "Drizzleslap Report - %s" % server_version, email_text)
13
14=== modified file 'drizzle/automation/reports/drizzleslap.py'
15--- drizzle/automation/reports/drizzleslap.py 2009-11-12 16:15:46 +0000
16+++ drizzle/automation/reports/drizzleslap.py 2009-11-16 06:16:09 +0000
17@@ -1,5 +1,5 @@
18 #! /usr/bin/python
19-# -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
20+# -*- mode: python; c-basic-offset: 2; indent-tabs-mode: nil; -*-
21 # vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
22 #
23 # Copyright (C) 2009 Sun Microsystems
24@@ -31,7 +31,72 @@
25 import socket
26 import commands
27
28-def getDrizzleslapReport(working_dir, run_id, run_date, server_name, bzr_branch, bzr_revision):
29+def sqlQueryString(last_revs, run_id):
30+ sql= """
31+SELECT
32+ i.test_name
33+, i.concurrency
34+, format(AVG(i.total_time),3) AS total_time
35+, IF (AVG(i.total_time) >= agg.avg_total_time
36+ , FORMAT(CONCAT('+', ROUND(((AVG(i.total_time) - agg.avg_total_time) / agg.avg_total_time) * 100, 2), '%%') ,3)
37+ , FORMAT(CONCAT('-', ROUND(((agg.avg_total_time - AVG(i.total_time)) / agg.avg_total_time) * 100, 2), '%%'),3)
38+ ) as pct_diff_from_avg
39+, FORMAT(ROUND((AVG(i.total_time) - agg.avg_total_time), 2),3) AS diff_from_avg
40+, IF(ABS(AVG(i.total_time) - agg.avg_total_time) <= agg.stddev_total_time
41+ , 'within norms'
42+ , 'outside norms'
43+ ) as is_normal
44+, FORMAT(agg.min_total_time,3) AS min_total_time
45+, FORMAT(agg.max_total_time,3) AS max_total_time
46+, FORMAT(agg.avg_total_time,3) AS avg_total_time
47+, FORMAT(agg.stddev_total_time,3) AS stddev_total_time
48+FROM sysbench_config c
49+NATURAL JOIN sysbench_runs r
50+NATURAL JOIN drizzleslap_run_iterations i
51+INNER JOIN (
52+ SELECT
53+ test_name
54+ , MIN(total_time) as min_total_time
55+ , MAX(total_time) as max_total_time
56+ , AVG(total_time) as avg_total_time
57+ , STDDEV(total_time) as stddev_total_time
58+ FROM drizzleslap_run_iterations iter
59+ WHERE run_id IN (%s)
60+ GROUP BY test_name, concurrency
61+) AS agg
62+ ON i.test_name = agg.test_name
63+WHERE r.run_id = %d
64+GROUP BY i.test_name, i.concurrency
65+ORDER BY i.test_name, i.concurrency
66+ """ % (
67+ ",".join(last_revs)
68+ , run_id
69+ )
70+
71+ return db.get_select(sql)
72+
73+def printResults(results, report_text):
74+ """ Print out the sql results for a query """
75+
76+ for result in results:
77+ report_text= report_text + "\t".join(result) + "\n"
78+ return report_text
79+
80+def printHeader(string, report_text):
81+ """Returns header information for each section """
82+ report_text= report_text + """
83+=======================================================================================
84+
85+TRENDING OVER %s
86+
87+Test\tCon\tTime\t%% Diff from Avg Diff\tNorm?\tMin\tMax\tAvg\tSTD
88+=======================================================================================
89+""" % (string)
90+
91+ return report_text
92+
93+
94+def getDrizzleslapReport(working_dir, drizzleslap_config_name, run_id, run_date, server_name, bzr_branch, bzr_revision):
95 """Returns a textual report of the results over a series of runs"""
96
97 # Find the revision comment from BZR
98@@ -57,75 +122,45 @@
99 else:
100 full_commentary= None
101
102- rev_range= range(int(bzr_revision) - 4, int(bzr_revision) + 1)
103- revision_versions= ""
104- for rev in rev_range:
105- revision_versions= revision_versions + "'" + bzr_branch + '-' + str(rev) + "',"
106- # Cut off the last comma...
107- revision_versions= revision_versions[0:-1]
108-
109 sql= """
110 SELECT
111- r.version
112-, r.run_id
113-, r.run_date
114-, i.test_name
115-, i.concurrency
116-, i.total_time
117-, IF (i.total_time >= agg.avg_time
118- , CONCAT('-', ROUND(((i.total_time - agg.avg_time) / agg.avg_time) * 100, 2), '%')
119- , CONCAT('+', ROUND(((agg.avg_time - i.total_time) / agg.avg_time) * 100, 2), '%')
120- ) as pct_change
121-, ROUND((i.total_time - agg.avg_time), 2) as diff_from_avg
122-, IF(ABS(i.total_time - agg.avg_time) <= agg.stddev_time
123- , 'within norms'
124- , 'outside norms'
125- ) as normal
126-, agg.min_time
127-, agg.max_time
128-, agg.avg_time
129-, agg.stddev_time
130+ run_id
131 FROM sysbench_config c
132 NATURAL JOIN sysbench_runs r
133-NATURAL JOIN drizzleslap_run_iterations i
134-INNER JOIN (
135- SELECT
136- test_name
137- , concurrency
138- , MIN(total_time) as min_time
139- , MAX(total_time) as max_time
140- , AVG(total_time) as avg_time
141- , STDDEV(total_time) as stddev_time
142- FROM drizzleslap_run_iterations
143- NATURAL JOIN sysbench_runs runs
144- WHERE runs.server = '%s'
145- GROUP BY test_name, concurrency
146-) AS agg
147-ON i.test_name = agg.test_name
148-AND i.concurrency = agg.concurrency
149-WHERE r.server = '%s'
150-AND r.version IN (%s)
151-GROUP BY r.version, r.run_id, i.test_name, i.concurrency
152-ORDER BY i.test_name, r.version DESC, r.run_id DESC, i.concurrency
153- """ % (
154- server_name
155+WHERE c.name = '%s'
156+AND r.server = '%s'
157+AND r.version LIKE '%s%%'
158+AND r.run_id <= %d
159+ORDER BY run_id DESC
160+LIMIT 20
161+""" % (
162+ drizzleslap_config_name
163 , server_name
164- , revision_versions
165+ , bzr_branch
166+ , run_id
167 )
168+ results= db.get_select(sql)
169+
170+ last_5_revs= []
171+ last_20_revs= []
172+ x= 0
173+ for result in results:
174+ cur_run_id= int(result[0])
175+ if x < 5:
176+ last_5_revs.append(str(cur_run_id))
177+ last_20_revs.append(str(cur_run_id))
178+ x= x + 1
179
180 report_text= """=======================================================================================
181-REGRESSION REPORT
182+DRIZZLESLAP REPORT
183 =======================================================================================
184 MACHINE: %s
185 RUN ID: %d
186 RUN DATE: %s
187-SERVER: %s
188+SERVER: %s
189 VERSION: %s
190 REVISION: %d
191 COMMENT: %s
192-=======================================================================================
193-Version\t\tRun ID\t\tDate\t\tTest\tConc\tTime\t% Chg\tDiff\tNorm?\tMin\tMax\tAvg\tSTD
194-=======================================================================================
195 """ % (
196 socket.gethostname()
197 , run_id
198@@ -136,14 +171,69 @@
199 , rev_comment
200 )
201
202- # Calculate deviations?
203+ report_text= printHeader('LAST 5 runs', report_text)
204+ results= sqlQueryString(last_5_revs, run_id)
205+ report_text= printResults(results, report_text)
206+
207+ report_text= printHeader('LAST 20 runs', report_text)
208+ results= sqlQueryString(last_20_revs, run_id)
209+ report_text= printResults(results, report_text)
210+
211+ report_text= printHeader('ALL runs', report_text)
212+
213+ sql= """
214+SELECT
215+ i.test_name
216+, i.concurrency
217+, FORMAT(AVG(i.total_time),3) AS total_time
218+, IF (AVG(i.total_time) >= agg.avg_total_time
219+ , FORMAT(CONCAT('+', ROUND(((AVG(i.total_time) - agg.avg_total_time) / agg.avg_total_time) * 100, 2), '%%'),3)
220+ , FORMAT(CONCAT('-', ROUND(((agg.avg_total_time - AVG(i.total_time)) / agg.avg_total_time) * 100, 2), '%%'),3)
221+ ) as pct_diff_from_avg
222+, FORMAT(ROUND((AVG(i.total_time) - agg.avg_total_time), 2),3) as diff_from_avg
223+, IF(ABS(AVG(i.total_time) - agg.avg_total_time) <= agg.stddev_total_time
224+ , 'within norms'
225+ , 'outside norms'
226+ ) as is_normal
227+, FORMAT(agg.min_total_time,3) AS min_total_time
228+, FORMAT(agg.max_total_time,3) AS max_total_time
229+, FORMAT(agg.avg_total_time,3) AS avg_total_time
230+, FORMAT(agg.stddev_total_time,3) AS stddev_total_time
231+FROM sysbench_config c
232+NATURAL JOIN sysbench_runs r
233+NATURAL JOIN drizzleslap_run_iterations i
234+INNER JOIN (
235+ SELECT
236+ iter.test_name
237+ , MIN(total_time) as min_total_time
238+ , MAX(total_time) as max_total_time
239+ , AVG(total_time) as avg_total_time
240+ , STDDEV(total_time) as stddev_total_time
241+ FROM sysbench_config conf
242+ NATURAL JOIN sysbench_runs runs
243+ NATURAL JOIN drizzleslap_run_iterations iter
244+ WHERE conf.name = '%s'
245+ AND runs.server = '%s'
246+ AND runs.version LIKE '%s%%'
247+ GROUP BY iter.test_name, iter.concurrency
248+) AS agg
249+ ON i.test_name = agg.test_name
250+WHERE r.run_id = %d
251+GROUP BY i.test_name, i.concurrency
252+ORDER BY i.test_name, i.concurrency
253+ """ % (
254+ drizzleslap_config_name
255+ , server_name
256+ , bzr_branch
257+ , run_id
258+ )
259
260 results= db.get_select(sql)
261- for result in results:
262- report_text= report_text + "\t".join(result) + "\n"
263- report_text= report_text + "=================================================================="
264+ report_text= printResults(results, report_text)
265+
266 if full_commentary:
267 report_text= report_text + """
268+=======================================================================================
269 FULL REVISION COMMENTARY:
270
271 %s""" % full_commentary
272
273=== modified file 'drizzle/automation/reports/sqlbench.py'
274--- drizzle/automation/reports/sqlbench.py 2009-11-07 22:31:48 +0000
275+++ drizzle/automation/reports/sqlbench.py 2009-11-16 06:16:09 +0000
276@@ -102,8 +102,6 @@
277 , rev_comment
278 )
279
280- # Calculate deviations?
281-
282 results= db.get_select(sql)
283 for result in results:
284 report_text= report_text + "\t".join(result) + "\n"
285
286=== modified file 'drizzle/automation/reports/sysbench.py'
287--- drizzle/automation/reports/sysbench.py 2009-11-13 19:50:26 +0000
288+++ drizzle/automation/reports/sysbench.py 2009-11-16 06:16:09 +0000
289@@ -44,10 +44,6 @@
290 # 1039.2.8: Jay Pipes 2009-05-31 Yet more indentation and style cleanup
291 # 1039.2.7: Jay Pipes 2009-05-31 Yet more style and indentation cleanups.
292 # 1039.2.6: Jay Pipes 2009-05-31 No code changes...only indentation and style cleanup.
293- # 1039.2.5: Jay Pipes 2009-05-31 Style cleanups and moves JOIN_TAB definition out into its own header.
294- # 1039.2.4: Jay Pipes 2009-05-31 Tiny indentation cleanup.
295- # 1039.2.3: Jay Pipes 2009-05-31 Phase 3 of refactoring JOIN
296- # 1039.2.2: Jay Pipes 2009-05-31 Phase 2 of JOIN refactoring.
297
298 comment_lines= rev_comment_output.split("\n")
299 rev_comment= comment_lines[0]
300
301=== modified file 'drizzle/automation/server/drizzled.py'
302--- drizzle/automation/server/drizzled.py 2009-10-27 19:49:11 +0000
303+++ drizzle/automation/server/drizzled.py 2009-11-16 06:16:09 +0000
304@@ -81,8 +81,9 @@
305 start_cmd= self._profiler.getStartCmdPrefix() + " "
306 else:
307 start_cmd= ""
308- start_cmd= start_cmd + "%s --port=%d --basedir=%s --datadir=%s %s > error.log 2>&1 &" % (os.path.join(self._basedir, "drizzled", "drizzled")
309+ start_cmd= start_cmd + "%s --drizzle-protocol-port=%d --mysql-protocol-port=%d --basedir=%s --datadir=%s %s > error.log 2>&1 &" % (os.path.join(self._basedir, "drizzled", "drizzled")
310 , self._port
311+ , self._port+1
312 , self._basedir
313 , self._datadir
314 , start_option_string)

Subscribers

People subscribed via source and target branches

to all changes: