зеркало из https://github.com/mozilla/gecko-dev.git
b=353986, new-graph fixes, new baseline feature; r=vlad, patch from dmills@mozilla.com
This commit is contained in:
Родитель
ce7c3f0356
Коммит
b51df21c7f
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
|
||||
import cgitb; cgitb.enable()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# bonsaibouncer
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
|
||||
import cgitb; cgitb.enable()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
|
||||
import cgitb; cgitb.enable()
|
||||
|
||||
|
@ -66,7 +66,7 @@ def doListTests(fo):
|
|||
results = []
|
||||
|
||||
cur = db.cursor()
|
||||
cur.execute("SELECT id, machine, test, test_type, extra_data FROM dataset_info")
|
||||
cur.execute("SELECT id, machine, test, test_type, extra_data FROM dataset_info WHERE test_type != ?", ("baseline",))
|
||||
for row in cur:
|
||||
results.append( {"id": row[0],
|
||||
"machine": row[1],
|
||||
|
@ -104,6 +104,22 @@ def doSendResults(fo, setid, starttime, endtime, raw):
|
|||
cur.close()
|
||||
fo.write ("],")
|
||||
|
||||
cur = db.cursor()
|
||||
cur.execute("SELECT test FROM dataset_info WHERE id = ?", (setid,))
|
||||
row = cur.fetchone()
|
||||
test_name = row[0]
|
||||
|
||||
cur.execute("SELECT id, extra_data FROM dataset_info WHERE test = ? and test_type = ?", (test_name, "baseline"))
|
||||
baselines = cur.fetchall()
|
||||
|
||||
fo.write ("baselines: {")
|
||||
for baseline in baselines:
|
||||
cur.execute("SELECT value FROM dataset_values WHERE dataset_id = ? LIMIT 1", (baseline[0],))
|
||||
row = cur.fetchone()
|
||||
fo.write("'%s': '%s'," % (baseline[1], row[0]))
|
||||
fo.write("},")
|
||||
cur.close()
|
||||
|
||||
if raw:
|
||||
cur = db.cursor()
|
||||
cur.execute("SELECT time, data FROM dataset_extra_data WHERE dataset_id = ? " + s1 + s2 + " ORDER BY time", (setid,))
|
||||
|
|
|
@ -440,6 +440,24 @@ Graph.prototype = {
|
|||
continue;
|
||||
}
|
||||
|
||||
for (baseline in this.dataSets[i].baselines) {
|
||||
save();
|
||||
var v = ch - Math.round((this.dataSets[i].baselines[baseline] - yoffs) * this.yScale);
|
||||
var x0 = Math.round((this.startTime - xoffs) * xscale);
|
||||
var x1 = Math.round((this.endTime - xoffs) * xscale);
|
||||
beginPath();
|
||||
moveTo(x0-0.5, v+0.5);
|
||||
lineTo(x1+0.5, v+0.5);
|
||||
strokeStyle = colorToRgbString(this.dataSets[i].color);
|
||||
globalAlpha = 0.2;
|
||||
lineWidth = 5.0;
|
||||
stroke();
|
||||
restore();
|
||||
strokeStyle = colorToRgbString(this.dataSets[i].color);
|
||||
lineWidth = 1.0;
|
||||
stroke();
|
||||
}
|
||||
|
||||
//log ("ds start end", this.startTime, this.endTime, "timediff:", (this.endTime - this.startTime));
|
||||
save();
|
||||
scale(xscale, -this.yScale);
|
||||
|
|
|
@ -81,10 +81,8 @@ GraphFormModule.prototype = {
|
|||
form.appendChild(td);
|
||||
|
||||
td = new SPAN();
|
||||
el = new IMG({ style: "border: 1px solid black; vertical-align: middle; margin: 3px;",
|
||||
width: 15,
|
||||
height: 15,
|
||||
src: "js/img/clear.png" });
|
||||
el = new DIV({ id: "whee", style: "display: inline; border: 1px solid black; height: 15; " +
|
||||
"padding-right: 15; vertical-align: middle; margin: 3px;" });
|
||||
this.colorDiv = el;
|
||||
td.appendChild(el);
|
||||
form.appendChild(td);
|
||||
|
@ -130,7 +128,7 @@ GraphFormModule.prototype = {
|
|||
});
|
||||
|
||||
for each (var test in sortedTests) {
|
||||
var tstr = test.machine + " - " + test.test + " (" + test.test_type + ")";
|
||||
var tstr = test.machine + " - " + test.test;
|
||||
opts.push(new OPTION({ value: test.id }, tstr));
|
||||
}
|
||||
replaceChildNodes(self.testSelect, opts);
|
||||
|
|
|
@ -171,6 +171,8 @@ TinderboxData.prototype = {
|
|||
self.testData[testId] = ds;
|
||||
if (obj.annotations)
|
||||
ds.annotations = new TimeStringDataSet(obj.annotations);
|
||||
if (obj.baselines)
|
||||
ds.baselines = obj.baselines;
|
||||
|
||||
self.onDataSetAvailable.fire(testId, ds, startTime, endTime);
|
||||
},
|
||||
|
|
|
@ -397,10 +397,16 @@ function lighterColor(col) {
|
|||
}
|
||||
|
||||
function colorToRgbString(col) {
|
||||
return "rgba("
|
||||
if (col[3] < 1) {
|
||||
return "rgba("
|
||||
+ Math.floor(col[0]*255) + ","
|
||||
+ Math.floor(col[1]*255) + ","
|
||||
+ Math.floor(col[2]*255) + ","
|
||||
+ col[3]
|
||||
+ ")";
|
||||
}
|
||||
return "rgb("
|
||||
+ Math.floor(col[0]*255) + ","
|
||||
+ Math.floor(col[1]*255) + ","
|
||||
+ Math.floor(col[2]*255) + ","
|
||||
+ col[3]
|
||||
+ ")";
|
||||
+ Math.floor(col[2]*255) + ")";
|
||||
}
|
||||
|
|
|
@ -1,20 +1,33 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python
|
||||
|
||||
import string
|
||||
import sys
|
||||
import time
|
||||
import re
|
||||
from optparse import OptionParser
|
||||
from optparse import OptionValueError
|
||||
|
||||
from pysqlite2 import dbapi2 as sqlite
|
||||
|
||||
if len(sys.argv) < 3 or len(sys.argv) > 4:
|
||||
print "Usage: import.py test_name tinderbox_name [replace] < data.txt"
|
||||
parser = OptionParser(usage="Usage: %prog [options] test_name tinderbox_name < data.txt")
|
||||
parser.add_option("-b", "--baseline", dest="baseline", metavar="NAME",
|
||||
action="store", default=None,
|
||||
help="use as baseline data for a test of the same name")
|
||||
parser.add_option("-r", "--replace", dest="replace",
|
||||
action="store_true", default=False,
|
||||
help="remove current data for this test and re-add all data")
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
if options.baseline == None:
|
||||
test_type = "perf"
|
||||
else:
|
||||
test_type = "baseline"
|
||||
|
||||
if len(args) != 2:
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
|
||||
(testname, tbox) = sys.argv[1:3]
|
||||
replace = False
|
||||
if len(sys.argv) == 4:
|
||||
replace = True
|
||||
(testname, tbox) = args[0:2]
|
||||
|
||||
DBPATH = "db/data.sqlite"
|
||||
db = sqlite.connect(DBPATH)
|
||||
|
@ -33,17 +46,17 @@ setid = -1
|
|||
while setid == -1:
|
||||
cur = db.cursor()
|
||||
cur.execute("SELECT id FROM dataset_info WHERE machine=? AND test=? AND test_type=?",
|
||||
(tbox, testname, "perf"))
|
||||
(tbox, testname, test_type))
|
||||
res = cur.fetchall()
|
||||
cur.close()
|
||||
|
||||
if len(res) == 0:
|
||||
db.execute("INSERT INTO dataset_info (machine, test, test_type) VALUES (?,?,?)",
|
||||
(tbox, testname, "perf"))
|
||||
db.execute("INSERT INTO dataset_info (machine, test, test_type, extra_data) VALUES (?,?,?,?)",
|
||||
(tbox, testname, test_type, options.baseline))
|
||||
else:
|
||||
setid = res[0][0]
|
||||
|
||||
if replace:
|
||||
if options.replace:
|
||||
db.execute("DELETE FROM dataset_values WHERE dataset_id = ?", (setid,))
|
||||
db.execute("DELETE FROM dataset_extra_data WHERE dataset_id = ?", (setid,))
|
||||
|
||||
|
@ -58,18 +71,25 @@ else:
|
|||
db.commit() # release any locks
|
||||
|
||||
count = 0
|
||||
linenum = 0
|
||||
line = sys.stdin.readline()
|
||||
while line is not None:
|
||||
linenum = linenum + 1
|
||||
|
||||
chunks = string.split(line, "\t")
|
||||
if len(chunks) == 1 and chunks[0] == '':
|
||||
break # don't warn about empty lines
|
||||
if len(chunks) != 6 and len(chunks) != 7:
|
||||
print "chunks not 6 or 7:", len(chunks)
|
||||
print "chunks not 6 or 7:", len(chunks), "line#", linenum, "value:", chunks
|
||||
break
|
||||
|
||||
if len(chunks) == 6:
|
||||
(datestr, val, data, ip, tinderbox, ua) = chunks[0:6]
|
||||
elif len(chunks) == 7:
|
||||
(datestr, val, codate, data, ip, tinderbox, ua) = chunks[0:7]
|
||||
else:
|
||||
raise "Unknown chunk length"
|
||||
(datestr, val, codate, data, ip, tinderbox, ua) = chunks[0:7]
|
||||
foo = string.split(codate, '=')
|
||||
if foo[0] == "MOZ_CO_DATE":
|
||||
datestr = foo[1]
|
||||
|
||||
timeval = time.mktime(map(int, string.split(datestr, ":")) + [0, 0, 0])
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче