Skip to content

Commit

Permalink
contest: results: don't flatten combined results
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jan 12, 2024
1 parent 593a3aa commit 08e250a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 14 deletions.
9 changes: 2 additions & 7 deletions contest/results-fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,8 @@ def build_combined(config, remote_db):
with open(file, "r") as fp:
data = json.load(fp)

for test in data['results']:
row = {}
for k in ['executor', 'branch', 'start', 'end']:
row[k] = data[k]
row['remote'] = name
row.update(test)
combined.append(row)
data['remote'] = name
combined.append(data)
return combined


Expand Down
29 changes: 27 additions & 2 deletions status.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,36 @@ <h3>Processing times (by patch post time)</h3>
<tr>
<th>Branch</th>
<th>Remote</th>
<th>Test</th>
<th>Time</th>
<th>Tests</th>
<th>Result</th>
</tr>
</table>
</div>
</div>
</body>
</html>
</html>function msec_to_str(msec) {
const convs = [
[1, "msec"],
[1000, "s"],
[60, "m"],
[60, "h"],
[24, "d"],
[7, "w"]
];

for (i = 0; i < convs.length; i++) {
if (msec < convs[i][0]) {
var full = Math.round(msec) + convs[i - 1][1];
if (i > 1) {
var frac = Math.round(msec * convs[i - 1][0] % convs[i - 1][0]);
if (frac)
full += frac + convs[i - 2][1];
}
return full;
}
msec /= convs[i][0];
}

return "TLE";
}
42 changes: 37 additions & 5 deletions status.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,32 @@ function colorify_str_psf(value)
return ret + value + '</p>';
}

function msec_to_str(msec) {
const convs = [
[1, "ms"],
[1000, "s"],
[60, "m"],
[60, "h"],
[24, "d"],
[7, "w"]
];

for (i = 0; i < convs.length; i++) {
if (msec < convs[i][0]) {
var full = Math.round(msec) + convs[i - 1][1];
if (i > 1) {
var frac = Math.round(msec * convs[i - 1][0] % convs[i - 1][0]);
if (frac)
full += " " + frac + convs[i - 2][1];
}
return full;
}
msec /= convs[i][0];
}

return "TLE";
}

function load_result_table(data_raw)
{
var table = document.getElementById("contest");
Expand All @@ -276,15 +302,21 @@ function load_result_table(data_raw)

var branch = row.insertCell(0);
var remote = row.insertCell(1);
var test = row.insertCell(2);
var res = row.insertCell(3);
var time = row.insertCell(2);
var cnt = row.insertCell(3);
var res = row.insertCell(4);

var t_start = new Date(v.start);
var t_end = new Date(v.end);
var a = "<a href=\"" + v.link + "\">";

if (v.remote != "brancher")
remote.innerHTML = v.remote;
remote.innerHTML = a + v.remote + "</a>";
else
branch.innerHTML = v.branch;
branch.innerHTML = a + v.branch + "</a>";

test.innerHTML = "<a href=\"" + v.link + "\">" + v.test + "</a>";
time.innerHTML = msec_to_str(t_end - t_start);
cnt.innerHTML = 1;
res.innerHTML = colorify_str_psf(v.result);
});
}
Expand Down

0 comments on commit 08e250a

Please sign in to comment.