Change stamp to sort_order
This commit is contained in:
Родитель
d882254a78
Коммит
1c22009d0b
|
@ -21,7 +21,7 @@ def notProcessedRuns():
|
|||
c = awfy.db.cursor()
|
||||
c.execute("SELECT id \
|
||||
FROM awfy_run \
|
||||
WHERE stamp > "+str(newer)+" AND \
|
||||
WHERE finish_stamp > "+str(newer)+" AND \
|
||||
status = 1 AND \
|
||||
detector != 1 AND \
|
||||
machine in (28,29,26,17,30)")
|
||||
|
|
|
@ -596,7 +596,7 @@ class Score(RegressionTools):
|
|||
return True
|
||||
|
||||
def prefetch_next(self, limit = 1):
|
||||
stamp = self.get("build").get("run").get("stamp")
|
||||
sort_order = self.get("build").get("run").get("sort_order")
|
||||
machine = self.get("build").get("run").get("machine_id")
|
||||
mode = self.get("build").get("mode_id")
|
||||
suite = self.get("suite_version_id")
|
||||
|
@ -606,18 +606,18 @@ class Score(RegressionTools):
|
|||
FROM awfy_score \
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id \
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id \
|
||||
WHERE stamp > %s AND \
|
||||
WHERE sort_order > %s AND \
|
||||
machine = %s AND \
|
||||
mode_id = %s AND \
|
||||
suite_version_id = %s AND \
|
||||
status = 1 \
|
||||
ORDER BY stamp ASC \
|
||||
LIMIT "+str(limit), (stamp, machine, mode, suite))
|
||||
ORDER BY sort_order ASC \
|
||||
LIMIT "+str(limit), (sort_order, machine, mode, suite))
|
||||
rows = c.fetchall()
|
||||
return [Score(row[0]) for row in rows]
|
||||
|
||||
def prefetch_prev(self, limit = 1):
|
||||
stamp = self.get("build").get("run").get("stamp")
|
||||
sort_order = self.get("build").get("run").get("sort_order")
|
||||
machine = self.get("build").get("run").get("machine_id")
|
||||
mode = self.get("build").get("mode_id")
|
||||
suite = self.get("suite_version_id")
|
||||
|
@ -627,13 +627,13 @@ class Score(RegressionTools):
|
|||
FROM awfy_score \
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id \
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id \
|
||||
WHERE stamp < %s AND \
|
||||
WHERE sort_order < %s AND \
|
||||
machine = %s AND \
|
||||
mode_id = %s AND \
|
||||
suite_version_id = %s AND \
|
||||
status = 1 \
|
||||
ORDER BY stamp DESC \
|
||||
LIMIT 1", (stamp, machine, mode, suite))
|
||||
ORDER BY sort_order DESC \
|
||||
LIMIT 1", (sort_order, machine, mode, suite))
|
||||
rows = c.fetchall()
|
||||
return [Score(row[0]) for row in rows]
|
||||
|
||||
|
@ -668,7 +668,7 @@ class Score(RegressionTools):
|
|||
|
||||
c = awfy.db.cursor()
|
||||
c.execute("SELECT id \
|
||||
FROM (SELECT awfy_score.id, stamp \
|
||||
FROM (SELECT awfy_score.id, sort_order \
|
||||
FROM awfy_score \
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id \
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id \
|
||||
|
@ -676,9 +676,9 @@ class Score(RegressionTools):
|
|||
mode_id = %s AND \
|
||||
suite_version_id = %s AND \
|
||||
status = 1 \
|
||||
ORDER BY stamp DESC \
|
||||
ORDER BY sort_order DESC \
|
||||
LIMIT 1000) tmp \
|
||||
ORDER BY stamp ASC \
|
||||
ORDER BY sort_order ASC \
|
||||
LIMIT 1", (machine.get("id"), mode.get("id"), suite.get("id")))
|
||||
row = c.fetchone()
|
||||
if row:
|
||||
|
@ -688,7 +688,7 @@ class Score(RegressionTools):
|
|||
def dump(self):
|
||||
import datetime
|
||||
print datetime.datetime.fromtimestamp(
|
||||
int(self.get("build").get("run").get("stamp"))
|
||||
int(self.get("build").get("run").get("finish_stamp"))
|
||||
).strftime('%Y-%m-%d %H:%M:%S'),
|
||||
print "", self.get("build").get("run").get("machine").get("description"),
|
||||
print "", self.get("build").get("mode").get("name"),
|
||||
|
@ -726,7 +726,7 @@ class Breakdown(RegressionTools):
|
|||
return True
|
||||
|
||||
def prefetch_next(self, limit = 1):
|
||||
stamp = self.get("build").get("run").get("stamp")
|
||||
sort_order = self.get("build").get("run").get("sort_order")
|
||||
machine = self.get("build").get("run").get("machine_id")
|
||||
mode = self.get("build").get("mode_id")
|
||||
suite = self.get("suite_test_id")
|
||||
|
@ -737,18 +737,18 @@ class Breakdown(RegressionTools):
|
|||
INNER JOIN awfy_score ON awfy_score.id = awfy_breakdown.score_id \
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id \
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id \
|
||||
WHERE stamp > %s AND \
|
||||
WHERE sort_order > %s AND \
|
||||
machine = %s AND \
|
||||
mode_id = %s AND \
|
||||
suite_test_id = %s AND \
|
||||
status = 1 \
|
||||
ORDER BY stamp ASC \
|
||||
LIMIT "+str(limit), (stamp, machine, mode, suite))
|
||||
ORDER BY sort_order ASC \
|
||||
LIMIT "+str(limit), (sort_order, machine, mode, suite))
|
||||
rows = c.fetchall()
|
||||
return [Breakdown(row[0]) for row in rows]
|
||||
|
||||
def prefetch_prev(self, limit = 1):
|
||||
stamp = self.get("build").get("run").get("stamp")
|
||||
sort_order = self.get("build").get("run").get("sort_order")
|
||||
machine = self.get("build").get("run").get("machine_id")
|
||||
mode = self.get("build").get("mode_id")
|
||||
suite = self.get("suite_test_id")
|
||||
|
@ -759,13 +759,13 @@ class Breakdown(RegressionTools):
|
|||
INNER JOIN awfy_score ON awfy_score.id = awfy_breakdown.score_id \
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id \
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id \
|
||||
WHERE stamp < %s AND \
|
||||
WHERE sort_order < %s AND \
|
||||
machine = %s AND \
|
||||
mode_id = %s AND \
|
||||
suite_test_id = %s AND \
|
||||
status = 1 \
|
||||
ORDER BY stamp DESC \
|
||||
LIMIT "+str(limit), (stamp, machine, mode, suite))
|
||||
ORDER BY sort_order DESC \
|
||||
LIMIT "+str(limit), (sort_order, machine, mode, suite))
|
||||
rows = c.fetchall()
|
||||
return [Breakdown(row[0]) for row in rows]
|
||||
|
||||
|
@ -777,7 +777,7 @@ class Breakdown(RegressionTools):
|
|||
|
||||
c = awfy.db.cursor()
|
||||
c.execute("SELECT id \
|
||||
FROM (SELECT awfy_breakdown.id, stamp \
|
||||
FROM (SELECT awfy_breakdown.id, sort_order \
|
||||
FROM awfy_breakdown \
|
||||
INNER JOIN awfy_score ON awfy_score.id = awfy_breakdown.score_id \
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id \
|
||||
|
@ -786,9 +786,9 @@ class Breakdown(RegressionTools):
|
|||
mode_id = %s AND \
|
||||
suite_test_id = %s AND \
|
||||
status = 1 \
|
||||
ORDER BY stamp DESC \
|
||||
ORDER BY sort_order DESC \
|
||||
LIMIT 1000) tmp \
|
||||
ORDER BY stamp ASC \
|
||||
ORDER BY sort_order ASC \
|
||||
LIMIT 1", (machine.get("id"), mode.get("id"), suite.get("id")))
|
||||
row = c.fetchone()
|
||||
if row:
|
||||
|
@ -821,7 +821,7 @@ class Breakdown(RegressionTools):
|
|||
def dump(self):
|
||||
import datetime
|
||||
print datetime.datetime.fromtimestamp(
|
||||
int(self.get("build").get("run").get("stamp"))
|
||||
int(self.get("build").get("run").get("finish_stamp"))
|
||||
).strftime('%Y-%m-%d %H:%M:%S'),
|
||||
print "", self.get("build").get("run").get("machine").get("description"),
|
||||
print "", self.get("build").get("mode").get("name"),
|
||||
|
|
|
@ -102,42 +102,6 @@ class Mode(object):
|
|||
self.color = color
|
||||
self.level = level
|
||||
|
||||
class Runs(object):
|
||||
def __init__(self, machine_id):
|
||||
self.runs = []
|
||||
self.map_ = {}
|
||||
c = awfy.db.cursor()
|
||||
c.execute("SELECT ar.id, ar.stamp \
|
||||
FROM awfy_run ar \
|
||||
JOIN awfy_score a ON ar.id = a.run_id \
|
||||
WHERE ar.machine = %s \
|
||||
AND ar.status <> 0 \
|
||||
GROUP BY ar.id \
|
||||
ORDER BY ar.stamp DESC \
|
||||
LIMIT 30", [machine_id])
|
||||
for row in c.fetchall():
|
||||
t = (row[0], row[1])
|
||||
self.map_[row[0]] = len(self.runs)
|
||||
self.runs.append(t)
|
||||
|
||||
self.earliest = int(self.runs[-1][1]) - time.timezone
|
||||
|
||||
def slot(self, run_id):
|
||||
return self.map_[run_id]
|
||||
|
||||
def length(self):
|
||||
return len(self.runs)
|
||||
|
||||
def contains(self, run_id):
|
||||
return run_id in self.map_
|
||||
|
||||
def export(self):
|
||||
list = []
|
||||
for run in self.runs:
|
||||
t = run[1] - time.timezone
|
||||
list.append(t)
|
||||
return list
|
||||
|
||||
class Context(object):
|
||||
def __init__(self):
|
||||
# Get a list of vendors, and map vendor IDs -> vendor info
|
||||
|
|
|
@ -29,12 +29,12 @@ for machine_row in machines:
|
|||
# Find the last time this machine submitted any data.
|
||||
c.execute(
|
||||
"""
|
||||
select stamp
|
||||
select finish_stamp
|
||||
from awfy_run
|
||||
where
|
||||
machine = %s and
|
||||
status = 1
|
||||
order by stamp desc
|
||||
order by finish_stamp desc
|
||||
limit 1
|
||||
""",
|
||||
(machine_id,)
|
||||
|
|
|
@ -42,8 +42,7 @@ def delete_metadata(prefix, data):
|
|||
os.remove(name)
|
||||
|
||||
def fetch_test_scores(machine_id, suite_id, name,
|
||||
finish_stamp = (0,"UNIX_TIMESTAMP()"),
|
||||
test_stamp = (0, "UNIX_TIMESTAMP()")):
|
||||
finish_stamp = (0, "UNIX_TIMESTAMP()")):
|
||||
c = awfy.db.cursor()
|
||||
query = "SELECT id FROM awfy_suite_test \
|
||||
WHERE name = %s"
|
||||
|
@ -52,7 +51,7 @@ def fetch_test_scores(machine_id, suite_id, name,
|
|||
for row in c.fetchall():
|
||||
suite_ids.append(str(row[0]))
|
||||
|
||||
query = "SELECT STRAIGHT_JOIN r.id, r.stamp, b.cset, s.score, b.mode_id, v.id, s.id \
|
||||
query = "SELECT STRAIGHT_JOIN r.id, r.finish_stamp, b.cset, s.score, b.mode_id, v.id, s.id \
|
||||
FROM awfy_run r \
|
||||
JOIN awfy_build b ON r.id = b.run_id \
|
||||
JOIN awfy_score s1 ON s1.build_id = b.id \
|
||||
|
@ -65,17 +64,14 @@ def fetch_test_scores(machine_id, suite_id, name,
|
|||
AND r.machine = %s \
|
||||
AND r.finish_stamp >= "+str(finish_stamp[0])+" \
|
||||
AND r.finish_stamp <= "+str(finish_stamp[1])+" \
|
||||
AND r.stamp >= "+str(test_stamp[0])+" \
|
||||
AND r.stamp <= "+str(test_stamp[1])+" \
|
||||
ORDER BY r.stamp ASC \
|
||||
ORDER BY r.sort_order ASC \
|
||||
"
|
||||
c.execute(query, [suite_id, machine_id])
|
||||
return c.fetchall()
|
||||
|
||||
def fetch_suite_scores(machine_id, suite_id,
|
||||
finish_stamp = (0,"UNIX_TIMESTAMP()"),
|
||||
test_stamp = (0, "UNIX_TIMESTAMP()")):
|
||||
query = "SELECT STRAIGHT_JOIN r.id, r.stamp, b.cset, s.score, b.mode_id, v.id, s.id \
|
||||
finish_stamp = (0, "UNIX_TIMESTAMP()")):
|
||||
query = "SELECT STRAIGHT_JOIN r.id, r.finish_stamp, b.cset, s.score, b.mode_id, v.id, s.id \
|
||||
FROM awfy_run r \
|
||||
JOIN awfy_build b ON r.id = b.run_id \
|
||||
JOIN awfy_score s ON s.build_id = b.id \
|
||||
|
@ -85,9 +81,7 @@ def fetch_suite_scores(machine_id, suite_id,
|
|||
AND r.machine = %s \
|
||||
AND r.finish_stamp >= "+str(finish_stamp[0])+" \
|
||||
AND r.finish_stamp <= "+str(finish_stamp[1])+" \
|
||||
AND r.stamp >= "+str(test_stamp[0])+" \
|
||||
AND r.stamp <= "+str(test_stamp[1])+" \
|
||||
ORDER BY r.stamp ASC \
|
||||
ORDER BY r.sort_order ASC \
|
||||
"
|
||||
c = awfy.db.cursor()
|
||||
c.execute(query, [suite_id, machine_id])
|
||||
|
@ -238,7 +232,7 @@ def renew_cache(cx, machine, suite, prefix, when, last_stamp, fetch):
|
|||
sys.stdout.write('Querying ' + prefix + '... ')
|
||||
sys.stdout.flush()
|
||||
with Profiler() as p:
|
||||
rows = fetch(machine, test_stamp=(start_stamp,stop_stamp))
|
||||
rows = fetch(machine, finish_stamp=(start_stamp,stop_stamp))
|
||||
diff = p.time()
|
||||
new_rows = len(rows)
|
||||
print('found ' + str(new_rows) + ' rows in ' + diff)
|
||||
|
@ -298,9 +292,8 @@ def perform_update(cx, machine, suite, prefix, fetch):
|
|||
# Done
|
||||
|
||||
def update(cx, machine, suite):
|
||||
def fetch_aggregate(machine, finish_stamp = (0,"UNIX_TIMESTAMP()"),
|
||||
test_stamp = (0, "UNIX_TIMESTAMP()")):
|
||||
return fetch_suite_scores(machine.id, suite.id, finish_stamp, test_stamp)
|
||||
def fetch_aggregate(machine, finish_stamp = (0,"UNIX_TIMESTAMP()")):
|
||||
return fetch_suite_scores(machine.id, suite.id, finish_stamp)
|
||||
|
||||
prefix = ""
|
||||
if suite.visible == 2:
|
||||
|
@ -315,9 +308,8 @@ def update(cx, machine, suite):
|
|||
return
|
||||
|
||||
for test_name in suite.tests:
|
||||
def fetch_test(machine, finish_stamp = (0,"UNIX_TIMESTAMP()"),
|
||||
test_stamp = (0, "UNIX_TIMESTAMP()")):
|
||||
return fetch_test_scores(machine.id, suite.id, test_name, finish_stamp, test_stamp)
|
||||
def fetch_test(machine, finish_stamp = (0,"UNIX_TIMESTAMP()")):
|
||||
return fetch_test_scores(machine.id, suite.id, test_name, finish_stamp)
|
||||
|
||||
prefix = ""
|
||||
if suite.visible == 2:
|
||||
|
|
|
@ -23,10 +23,12 @@ if (isset($_GET['requests'])) {
|
|||
// Start a full benchmark run. Request a token/number used to report/group
|
||||
// benchmark scores.
|
||||
if (isset($_GET['run']) && $_GET['run'] == 'yes') {
|
||||
// TODO: sort_order is not a date anymore. Adjust this logic to not take an
|
||||
// order, but only set this afterwards.
|
||||
$MACHINE = GET_int('MACHINE');
|
||||
$stamp = GET_int('stamp');
|
||||
$stamp = ($stamp != 0) ? $stamp : "UNIX_TIMESTAMP()";
|
||||
mysql_query("INSERT INTO awfy_run (machine, stamp)
|
||||
mysql_query("INSERT INTO awfy_run (machine, sort_order)
|
||||
VALUES
|
||||
($MACHINE, $stamp)")
|
||||
or die("ERROR: " . mysql_error());
|
||||
|
|
|
@ -11,10 +11,10 @@ init_database();
|
|||
$machine = (int)$_GET["machine"];
|
||||
$suiteVersion = (int)$_GET["suiteVersion"];
|
||||
|
||||
$query = "SELECT id, stamp FROM `awfy_run`
|
||||
$query = "SELECT id, finish_stamp, sort_order FROM `awfy_run`
|
||||
WHERE machine = $machine AND
|
||||
status = 1
|
||||
ORDER BY stamp DESC
|
||||
ORDER BY sort_order DESC
|
||||
LIMIT 1";
|
||||
$results = mysql_query($query);
|
||||
if (!$results || mysql_num_rows($results) != 1)
|
||||
|
@ -22,6 +22,7 @@ if (!$results || mysql_num_rows($results) != 1)
|
|||
$row = mysql_fetch_array($results);
|
||||
$overview["machine"] = $machine;
|
||||
$overview["stamp"] = $row[1];
|
||||
$overview["sort_order"] = $row[2];
|
||||
$overview["suiteVersion"] = $suiteVersion;
|
||||
|
||||
if (!has_permissions()) {
|
||||
|
@ -51,13 +52,14 @@ while($row = mysql_fetch_array($results)) {
|
|||
$mode = $row[0];
|
||||
|
||||
// Get last build of a specific mode (not older than 5 days from the newest result).
|
||||
$query = "SELECT awfy_build.id, stamp FROM `awfy_build`
|
||||
// TODO: sort_order is now not specific of a data anymore, but just ascending.
|
||||
$query = "SELECT awfy_build.id, finish_stamp FROM `awfy_build`
|
||||
LEFT JOIN awfy_run ON run_id = awfy_run.id
|
||||
WHERE awfy_build.mode_id = $mode AND
|
||||
machine = $machine AND
|
||||
stamp >= ".($overview["stamp"]-5*24*60*60)." AND
|
||||
sort_order >= ".($overview["sort_order"]-5*24*60*60)." AND
|
||||
status = 1
|
||||
ORDER BY stamp DESC
|
||||
ORDER BY sort_order DESC
|
||||
LIMIT 1";
|
||||
$buildInfo = mysql_query($query) or die(mysql_error());
|
||||
if (!$buildInfo || mysql_num_rows($buildInfo) != 1)
|
||||
|
|
|
@ -14,10 +14,10 @@ $machine = (int)$_GET["machine"];
|
|||
$overview = Array();
|
||||
|
||||
// Overall date.
|
||||
$query = "SELECT stamp FROM `awfy_run`
|
||||
$query = "SELECT finish_stamp, sort_order FROM `awfy_run`
|
||||
WHERE machine = $machine AND
|
||||
status = 1
|
||||
ORDER BY stamp DESC
|
||||
ORDER BY sort_order DESC
|
||||
LIMIT 1";
|
||||
$results = mysql_query($query);
|
||||
if (!$results || mysql_num_rows($results) != 1)
|
||||
|
@ -25,6 +25,7 @@ if (!$results || mysql_num_rows($results) != 1)
|
|||
$row = mysql_fetch_array($results);
|
||||
$overview["machine"] = $machine;
|
||||
$overview["stamp"] = $row[0];
|
||||
$overview["sort_order"] = $row[1];
|
||||
|
||||
// Get all modes.
|
||||
$query = "SELECT mode_id
|
||||
|
@ -42,13 +43,14 @@ while($row = mysql_fetch_array($results)) {
|
|||
$mode = $row[0];
|
||||
|
||||
// Get last build of a specific mode (not older than 5 days from the newest result).
|
||||
$query = "SELECT awfy_build.id, stamp FROM `awfy_build`
|
||||
// TODO: sort_order is now not specific of a data anymore, but just ascending.
|
||||
$query = "SELECT awfy_build.id, finish_stamp FROM `awfy_build`
|
||||
LEFT JOIN awfy_run ON run_id = awfy_run.id
|
||||
WHERE awfy_build.mode_id = $mode AND
|
||||
machine = $machine AND
|
||||
stamp >= ".($overview["stamp"]-5*24*60*60)." AND
|
||||
sort_order >= ".($overview["sort_order"]-5*24*60*60)." AND
|
||||
status = 1
|
||||
ORDER BY stamp DESC
|
||||
ORDER BY sort_order DESC
|
||||
LIMIT 1";
|
||||
$buildInfo = mysql_query($query) or die(mysql_error());
|
||||
if (!$buildInfo || mysql_num_rows($buildInfo) != 1)
|
||||
|
|
|
@ -3,25 +3,25 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function prev_($stamp, $machine, $mode, $suite, $limit = 1) {
|
||||
function prev_($sort_order_id, $machine, $mode, $suite, $limit = 1) {
|
||||
$limit = (int) $limit;
|
||||
$query = "SELECT awfy_score.id, score, cset
|
||||
FROM awfy_score
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id
|
||||
WHERE stamp < $1 AND
|
||||
stamp >= $2 AND
|
||||
WHERE sort_order < $1 AND
|
||||
sort_order >= $2 AND
|
||||
machine = ".(int)$machine." AND
|
||||
mode_id = ".(int)$mode." AND
|
||||
suite_version_id = ".(int)$suite." AND
|
||||
status = 1
|
||||
ORDER BY stamp DESC
|
||||
ORDER BY sort_order DESC
|
||||
LIMIT $3";
|
||||
$output = array();
|
||||
|
||||
$stamp_n = $stamp - 60 * 60;
|
||||
$query_n = str_replace("$1", $stamp , $query);
|
||||
$query_n = str_replace("$2", $stamp_n , $query_n);
|
||||
$sort_order_n = $sort_order_id - 60 * 60;
|
||||
$query_n = str_replace("$1", $sort_order_id, $query);
|
||||
$query_n = str_replace("$2", $sort_order_n , $query_n);
|
||||
$query_n = str_replace("$3", $limit , $query_n);
|
||||
$q = mysql_query($query_n) or die(mysql_error());
|
||||
while ($prevs = mysql_fetch_assoc($q)) {
|
||||
|
@ -31,10 +31,10 @@ function prev_($stamp, $machine, $mode, $suite, $limit = 1) {
|
|||
if (count($output) == $limit)
|
||||
return $output;
|
||||
|
||||
$stamp = $stamp_n;
|
||||
$stamp_n = $stamp - 60 * 60 * 24;
|
||||
$query_n = str_replace("$1", $stamp , $query);
|
||||
$query_n = str_replace("$2", $stamp_n , $query_n);
|
||||
$sort_order_id = $sort_order_n;
|
||||
$sort_order_n = $sort_order_id - 60 * 60 * 24;
|
||||
$query_n = str_replace("$1", $sort_order_id, $query);
|
||||
$query_n = str_replace("$2", $sort_order_n , $query_n);
|
||||
$query_n = str_replace("$3", $limit - count($output) , $query_n);
|
||||
$q = mysql_query($query_n) or die(mysql_error());
|
||||
while ($prevs = mysql_fetch_assoc($q)) {
|
||||
|
@ -44,10 +44,10 @@ function prev_($stamp, $machine, $mode, $suite, $limit = 1) {
|
|||
if (count($output) == $limit)
|
||||
return $output;
|
||||
|
||||
$stamp = $stamp_n;
|
||||
$stamp_n = 0;
|
||||
$query_n = str_replace("$1", $stamp , $query);
|
||||
$query_n = str_replace("$2", $stamp_n , $query_n);
|
||||
$sort_order_id = $sort_order_n;
|
||||
$sort_order_n = 0;
|
||||
$query_n = str_replace("$1", $sort_order_id, $query);
|
||||
$query_n = str_replace("$2", $sort_order_n , $query_n);
|
||||
$query_n = str_replace("$3", $limit - count($output) , $query_n);
|
||||
$q = mysql_query($query_n) or die(mysql_error());
|
||||
while ($prevs = mysql_fetch_assoc($q)) {
|
||||
|
@ -57,26 +57,26 @@ function prev_($stamp, $machine, $mode, $suite, $limit = 1) {
|
|||
return $output;
|
||||
}
|
||||
|
||||
function prev_suite_test($stamp, $machine, $mode, $suite_test, $limit = 1) {
|
||||
function prev_suite_test($sort_order_id, $machine, $mode, $suite_test, $limit = 1) {
|
||||
$limit = (int) $limit;
|
||||
$query = "SELECT awfy_breakdown.id, awfy_breakdown.score, cset
|
||||
FROM awfy_breakdown
|
||||
INNER JOIN awfy_score ON awfy_score.id = score_id
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id
|
||||
WHERE stamp < $1 AND
|
||||
stamp >= $2 AND
|
||||
WHERE sort_order < $1 AND
|
||||
sort_order >= $2 AND
|
||||
machine = ".(int)$machine." AND
|
||||
mode_id = ".(int)$mode." AND
|
||||
suite_test_id = ".(int)$suite_test." AND
|
||||
status = 1
|
||||
ORDER BY stamp DESC
|
||||
ORDER BY sort_order DESC
|
||||
LIMIT $3";
|
||||
$output = array();
|
||||
|
||||
$stamp_n = $stamp - 60 * 60;
|
||||
$query_n = str_replace("$1", $stamp , $query);
|
||||
$query_n = str_replace("$2", $stamp_n , $query_n);
|
||||
$sort_order_n = $sort_order_id - 60 * 60;
|
||||
$query_n = str_replace("$1", $sort_order_id , $query);
|
||||
$query_n = str_replace("$2", $sort_order_n , $query_n);
|
||||
$query_n = str_replace("$3", $limit , $query_n);
|
||||
$q = mysql_query($query_n) or die(mysql_error());
|
||||
while ($prevs = mysql_fetch_assoc($q)) {
|
||||
|
@ -86,10 +86,10 @@ function prev_suite_test($stamp, $machine, $mode, $suite_test, $limit = 1) {
|
|||
if (count($output) == $limit)
|
||||
return $output;
|
||||
|
||||
$stamp = $stamp_n;
|
||||
$stamp_n = $stamp - 60 * 60 * 24;
|
||||
$query_n = str_replace("$1", $stamp , $query);
|
||||
$query_n = str_replace("$2", $stamp_n , $query_n);
|
||||
$sort_order_id = $sort_order_n;
|
||||
$sort_order_n = $sort_order_id - 60 * 60 * 24;
|
||||
$query_n = str_replace("$1", $sort_order_id , $query);
|
||||
$query_n = str_replace("$2", $sort_order_n , $query_n);
|
||||
$query_n = str_replace("$3", $limit - count($output) , $query_n);
|
||||
$q = mysql_query($query_n) or die(mysql_error());
|
||||
while ($prevs = mysql_fetch_assoc($q)) {
|
||||
|
@ -99,10 +99,10 @@ function prev_suite_test($stamp, $machine, $mode, $suite_test, $limit = 1) {
|
|||
if (count($output) == $limit)
|
||||
return $output;
|
||||
|
||||
$stamp = $stamp_n;
|
||||
$stamp_n = 0;
|
||||
$query_n = str_replace("$1", $stamp , $query);
|
||||
$query_n = str_replace("$2", $stamp_n , $query_n);
|
||||
$sort_order_id = $sort_order_n;
|
||||
$sort_order_n = 0;
|
||||
$query_n = str_replace("$1", $sort_order_id , $query);
|
||||
$query_n = str_replace("$2", $sort_order_n , $query_n);
|
||||
$query_n = str_replace("$3", $limit - count($output) , $query_n);
|
||||
$q = mysql_query($query_n) or die(mysql_error());
|
||||
while ($prevs = mysql_fetch_assoc($q)) {
|
||||
|
@ -112,17 +112,17 @@ function prev_suite_test($stamp, $machine, $mode, $suite_test, $limit = 1) {
|
|||
return $output;
|
||||
}
|
||||
|
||||
function next_($stamp, $machine, $mode, $suite, $limit = 1) {
|
||||
function next_($sort_order_id, $machine, $mode, $suite, $limit = 1) {
|
||||
$query = mysql_query("SELECT awfy_score.id, score, cset
|
||||
FROM awfy_score
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id
|
||||
WHERE stamp > ".(int)$stamp." AND
|
||||
WHERE sort_order > ".(int)$sort_order_id." AND
|
||||
machine = ".(int)$machine." AND
|
||||
mode_id = ".(int)$mode." AND
|
||||
suite_version_id = ".(int)$suite." AND
|
||||
status = 1
|
||||
ORDER BY stamp ASC
|
||||
ORDER BY sort_order ASC
|
||||
LIMIT ".(int)$limit) or die(mysql_error());
|
||||
$output = array();
|
||||
while ($nexts = mysql_fetch_assoc($query)) {
|
||||
|
@ -131,18 +131,18 @@ function next_($stamp, $machine, $mode, $suite, $limit = 1) {
|
|||
return $output;
|
||||
}
|
||||
|
||||
function next_suite_test($stamp, $machine, $mode, $suite_test, $limit = 1) {
|
||||
function next_suite_test($sort_order_id, $machine, $mode, $suite_test, $limit = 1) {
|
||||
$query = mysql_query("SELECT awfy_breakdown.id, awfy_breakdown.score, cset
|
||||
FROM awfy_breakdown
|
||||
INNER JOIN awfy_score ON awfy_score.id = score_id
|
||||
INNER JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
INNER JOIN awfy_run ON awfy_run.id = awfy_build.run_id
|
||||
WHERE stamp > ".(int)$stamp." AND
|
||||
WHERE sort_order > ".(int)$sort_order_id." AND
|
||||
machine = ".(int)$machine." AND
|
||||
mode_id = ".(int)$mode." AND
|
||||
suite_test_id = ".(int)$suite_test." AND
|
||||
status = 1
|
||||
ORDER BY stamp ASC
|
||||
ORDER BY sort_order ASC
|
||||
LIMIT ".(int)$limit) or die(mysql_error());
|
||||
$output = array();
|
||||
while ($nexts = mysql_fetch_assoc($query)) {
|
||||
|
@ -160,7 +160,7 @@ function get($db, $id, $field) {
|
|||
}
|
||||
|
||||
function imm_prev_suite_test($breakdown_id) {
|
||||
$query = mysql_query("SELECT mode_id, machine, stamp, suite_test_id
|
||||
$query = mysql_query("SELECT mode_id, machine, sort_order, suite_test_id
|
||||
FROM `awfy_breakdown`
|
||||
LEFT JOIN awfy_score ON awfy_score.id = score_id
|
||||
LEFT JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
|
@ -168,7 +168,7 @@ function imm_prev_suite_test($breakdown_id) {
|
|||
WHERE awfy_breakdown.id = ".$breakdown_id) or die(mysql_error());
|
||||
$data = mysql_fetch_assoc($query);
|
||||
|
||||
$prev = prev_suite_test($data["stamp"], $data["machine"],
|
||||
$prev = prev_suite_test($data["sort_order"], $data["machine"],
|
||||
$data["mode_id"], $data["suite_test_id"]);
|
||||
|
||||
if (count($prev) == 1)
|
||||
|
@ -177,14 +177,14 @@ function imm_prev_suite_test($breakdown_id) {
|
|||
}
|
||||
|
||||
function imm_prev_($score_id) {
|
||||
$query = mysql_query("SELECT mode_id, machine, stamp, suite_version_id
|
||||
$query = mysql_query("SELECT mode_id, machine, sort_order, suite_version_id
|
||||
FROM `awfy_score`
|
||||
LEFT JOIN awfy_build ON awfy_build.id = build_id
|
||||
LEFT JOIN awfy_run ON awfy_run.id = run_id
|
||||
WHERE awfy_score.id = ".$score_id) or die(mysql_error());
|
||||
$data = mysql_fetch_assoc($query);
|
||||
|
||||
$prev = prev_($data["stamp"], $data["machine"],
|
||||
$prev = prev_($data["sort_order"], $data["machine"],
|
||||
$data["mode_id"], $data["suite_version_id"]);
|
||||
if (count($prev) == 1)
|
||||
return $prev[0]["id"];
|
||||
|
|
|
@ -11,25 +11,25 @@ $amount = Array();
|
|||
|
||||
$query = mysql_query("SELECT awfy_regression.id, build_id FROM awfy_regression
|
||||
INNER JOIN awfy_build ON awfy_build.id = build_id
|
||||
WHERE (mode_id = 14 OR
|
||||
mode_id = 28 or
|
||||
mode_id = 33 or
|
||||
mode_id = 26 or
|
||||
WHERE (mode_id = 14 OR
|
||||
mode_id = 28 or
|
||||
mode_id = 33 or
|
||||
mode_id = 26 or
|
||||
mode_id = 32 or
|
||||
mode_id = 20) AND
|
||||
status != 'fixed' AND status != 'improvement'");
|
||||
while ($regs = mysql_fetch_object($query)) {
|
||||
$qScore = mysql_query("SELECT count(*) as count FROM awfy_regression_score
|
||||
WHERE regression_id = ".$regs->id);
|
||||
WHERE regression_id = ".$regs->id);
|
||||
$score = mysql_fetch_object($qScore);
|
||||
$qBreakdown = mysql_query("SELECT count(*) as count FROM awfy_regression_breakdown
|
||||
WHERE regression_id = ".$regs->id);
|
||||
WHERE regression_id = ".$regs->id);
|
||||
$breakdown = mysql_fetch_object($qBreakdown);
|
||||
$qDate = mysql_query("SELECT stamp FROM awfy_build
|
||||
$qDate = mysql_query("SELECT finish_stamp FROM awfy_build
|
||||
LEFT JOIN awfy_run ON awfy_run.id = awfy_build.run_id
|
||||
WHERE awfy_build.id = ".$regs->build_id);
|
||||
WHERE awfy_build.id = ".$regs->build_id);
|
||||
$date = mysql_fetch_object($qDate);
|
||||
$date_str = date("Y", $date->stamp).",".(date("m", $date->stamp)*1-1).",".date("d", $date->stamp);
|
||||
$date_str = date("Y", $date->finish_stamp).",".(date("m", $date->finish_stamp)*1-1).",".date("d", $date->finish_stamp);
|
||||
|
||||
$amount[$date_str] += $score->count + $breakdown->count;
|
||||
}
|
||||
|
|
|
@ -14,15 +14,15 @@ if (!empty($request->score_id)) {
|
|||
$suite_version_id = get("score", (int)$request->score_id, "suite_version_id");
|
||||
$build_id = get("score", (int)$request->score_id, "build_id");
|
||||
$run_id = get("build", $build_id, "run_id");
|
||||
$stamp = get("run", $run_id, "stamp");
|
||||
$sort_order_id = get("run", $run_id, "sort_order");
|
||||
$machine = get("run", $run_id, "machine");
|
||||
$mode_id = get("build", $build_id, "mode_id");
|
||||
|
||||
if ($request->type == "prev") {
|
||||
$prev = prev_($stamp, $machine, $mode_id, $suite_version_id, (int)$request->amount);
|
||||
$prev = prev_($sort_order_id, $machine, $mode_id, $suite_version_id, (int)$request->amount);
|
||||
$last = array_pop($prev);
|
||||
} else {
|
||||
$next = next_($stamp, $machine, $mode_id, $suite_version_id, (int)$request->amount);
|
||||
$next = next_($sort_order_id, $machine, $mode_id, $suite_version_id, (int)$request->amount);
|
||||
$last = array_pop($next);
|
||||
}
|
||||
$build_id = get("score", $last["id"], "build_id");
|
||||
|
@ -31,15 +31,15 @@ if (!empty($request->score_id)) {
|
|||
$score_id = get("breakdown", (int)$request->breakdown_id, "score_id");
|
||||
$build_id = get("score", (int)$score_id, "build_id");
|
||||
$run_id = get("build", $build_id, "run_id");
|
||||
$stamp = get("run", $run_id, "stamp");
|
||||
$sort_order_id = get("run", $run_id, "sort_order");
|
||||
$machine = get("run", $run_id, "machine");
|
||||
$mode_id = get("build", $build_id, "mode_id");
|
||||
|
||||
if ($request->type == "prev") {
|
||||
$prev = prev_suite_test($stamp, $machine, $mode_id, $suite_test_id, (int)$request->amount);
|
||||
$prev = prev_suite_test($sort_order_id, $machine, $mode_id, $suite_test_id, (int)$request->amount);
|
||||
$last = array_pop($prev);
|
||||
} else {
|
||||
$next = next_suite_test($stamp, $machine, $mode_id, $suite_test_id, (int)$request->amount);
|
||||
$next = next_suite_test($sort_order_id, $machine, $mode_id, $suite_test_id, (int)$request->amount);
|
||||
$last = array_pop($next);
|
||||
}
|
||||
$score_id = get("breakdown", $last["id"], "score_id");
|
||||
|
@ -47,6 +47,6 @@ if (!empty($request->score_id)) {
|
|||
}
|
||||
|
||||
$run_id = get("build", $build_id, "run_id");
|
||||
$stamp = get("run", $run_id, "stamp");
|
||||
$stamp = get("run", $run_id, "finish_stamp");
|
||||
|
||||
echo $stamp;
|
||||
|
|
|
@ -24,7 +24,7 @@ $minimal = isset($request->minimal) ? !!$request->minimal : false;
|
|||
$data = array();
|
||||
for ($i=0; $i < count($ids); $i++) {
|
||||
|
||||
$query = mysql_query("SELECT awfy_regression.id, machine, mode_id, awfy_run.stamp,
|
||||
$query = mysql_query("SELECT awfy_regression.id, machine, mode_id, awfy_run.finish_stamp,
|
||||
build_id, prev_build_id, cset, bug, awfy_regression.status, detector
|
||||
FROM awfy_regression
|
||||
INNER JOIN awfy_build ON build_id = awfy_build.id
|
||||
|
@ -36,7 +36,7 @@ for ($i=0; $i < count($ids); $i++) {
|
|||
"id" => $output["id"],
|
||||
"machine" => $output["machine"],
|
||||
"mode" => $output["mode_id"],
|
||||
"stamp" => $output["stamp"],
|
||||
"stamp" => $output["finish_stamp"],
|
||||
"cset" => $output["cset"],
|
||||
"bug" => $output["bug"],
|
||||
"status" => $output["status"],
|
||||
|
|
|
@ -31,7 +31,7 @@ if (isset($request->rev)) {
|
|||
WHERE machine = ".$request->machine." AND
|
||||
mode_id = ".$request->mode." AND
|
||||
status = 1
|
||||
ORDER BY stamp DESC
|
||||
ORDER BY sort_order DESC
|
||||
LIMIT 1") or die(mysql_error());
|
||||
$data = mysql_fetch_assoc($query);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ if (!isset($request->subtest))
|
|||
$request->subtest = false;
|
||||
|
||||
if ($request->subtest == 1 || $request->subtest == 'true') {
|
||||
$query = mysql_query("SELECT mode_id, machine, stamp, awfy_breakdown.score, suite_test_id
|
||||
$query = mysql_query("SELECT mode_id, machine, finish_stamp as stamp, awfy_breakdown.score, suite_test_id, sort_order
|
||||
FROM `awfy_breakdown`
|
||||
LEFT JOIN awfy_score ON awfy_score.id = score_id
|
||||
LEFT JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
|
@ -23,7 +23,7 @@ if ($request->subtest == 1 || $request->subtest == 'true') {
|
|||
WHERE awfy_breakdown.id = ".$request->id) or die(mysql_error());
|
||||
$data = mysql_fetch_assoc($query);
|
||||
|
||||
$prev = prev_suite_test($data["stamp"], $data["machine"],
|
||||
$prev = prev_suite_test($data["sort_order"], $data["machine"],
|
||||
$data["mode_id"], $data["suite_test_id"]);
|
||||
if (count($prev) == 1)
|
||||
$data["prev_score"] = $prev[0]["score"];
|
||||
|
@ -33,14 +33,14 @@ if ($request->subtest == 1 || $request->subtest == 'true') {
|
|||
|
||||
die(json_encode($data));
|
||||
} else {
|
||||
$query = mysql_query("SELECT mode_id, machine, stamp, score, suite_version_id
|
||||
$query = mysql_query("SELECT mode_id, machine, finish_stamp as stamp, score, suite_version_id, sort_order
|
||||
FROM `awfy_score`
|
||||
LEFT JOIN awfy_build ON awfy_build.id = build_id
|
||||
LEFT JOIN awfy_run ON awfy_run.id = run_id
|
||||
WHERE awfy_score.id = ".$request->id) or die(mysql_error());
|
||||
$data = mysql_fetch_assoc($query);
|
||||
|
||||
$prev = prev_($data["stamp"], $data["machine"],
|
||||
$prev = prev_($data["sort_order"], $data["machine"],
|
||||
$data["mode_id"], $data["suite_version_id"]);
|
||||
if (count($prev) == 1)
|
||||
$data["prev_score"] = $prev[0]["score"];
|
||||
|
|
|
@ -38,12 +38,12 @@ if (!empty($bug))
|
|||
if ($bug === 0)
|
||||
$where[] = "awfy_regression.bug = ''";
|
||||
|
||||
$query = mysql_query("SELECT awfy_regression.id, machine, mode_id, awfy_run.stamp, build_id, cset, bug
|
||||
$query = mysql_query("SELECT awfy_regression.id
|
||||
FROM awfy_regression
|
||||
INNER JOIN awfy_build ON build_id = awfy_build.id
|
||||
INNER JOIN awfy_run ON run_id = awfy_run.id
|
||||
WHERE ".(join(" AND ", $where))."
|
||||
ORDER BY awfy_run.stamp DESC") or die(mysql_error());
|
||||
ORDER BY awfy_run.sort_order DESC") or die(mysql_error());
|
||||
$data = Array();
|
||||
while ($output = mysql_fetch_assoc($query)) {
|
||||
$data[] = $output["id"];
|
||||
|
|
|
@ -16,7 +16,7 @@ if (!isset($request->subtest))
|
|||
|
||||
$prev_build_id = 0;
|
||||
if ($request->subtest == 1 || $request->subtest == 'true') {
|
||||
$query = mysql_query("SELECT mode_id, machine, stamp, awfy_breakdown.score, suite_test_id, build_id
|
||||
$query = mysql_query("SELECT mode_id, machine, sort_order, awfy_breakdown.score, suite_test_id, build_id
|
||||
FROM `awfy_breakdown`
|
||||
LEFT JOIN awfy_score ON awfy_score.id = score_id
|
||||
LEFT JOIN awfy_build ON awfy_build.id = awfy_score.build_id
|
||||
|
@ -24,7 +24,7 @@ if ($request->subtest == 1 || $request->subtest == 'true') {
|
|||
WHERE awfy_breakdown.id = ".$request->id) or die(mysql_error());
|
||||
$data = mysql_fetch_assoc($query);
|
||||
|
||||
$prev = prev_suite_test($data["stamp"], $data["machine"],
|
||||
$prev = prev_suite_test($data["sort_order"], $data["machine"],
|
||||
$data["mode_id"], $data["suite_test_id"]);
|
||||
if (count($prev) == 1) {
|
||||
$prev_breakdown_id = $prev[0]["id"];
|
||||
|
@ -33,14 +33,14 @@ if ($request->subtest == 1 || $request->subtest == 'true') {
|
|||
}
|
||||
$build_id = $data["build_id"];
|
||||
} else {
|
||||
$query = mysql_query("SELECT mode_id, machine, stamp, score, suite_version_id, build_id
|
||||
$query = mysql_query("SELECT mode_id, machine, sort_order, score, suite_version_id, build_id
|
||||
FROM `awfy_score`
|
||||
LEFT JOIN awfy_build ON awfy_build.id = build_id
|
||||
LEFT JOIN awfy_run ON awfy_run.id = run_id
|
||||
WHERE awfy_score.id = ".$request->id) or die(mysql_error());
|
||||
$data = mysql_fetch_assoc($query);
|
||||
|
||||
$prev = prev_($data["stamp"], $data["machine"],
|
||||
$prev = prev_($data["sort_order"], $data["machine"],
|
||||
$data["mode_id"], $data["suite_version_id"]);
|
||||
if (count($prev) == 1) {
|
||||
$prev_score_id = $prev[0]["id"];
|
||||
|
|
Загрузка…
Ссылка в новой задаче