Commit ac31e561 authored by Daniel Smith's avatar Daniel Smith

Update completed jobs results to show performance improvements correctly.

parent 93bab68b
......@@ -230,6 +230,16 @@ notifyJob.on('JobDone', function(){
function jobFormatter(job, format){
// Do some formatting magic
function resultText(result){
if(result < 0 ){
return `Observed improvement: ${Math.abs(result)}%`;
} else if (result > 0){
return `Observed regression: ${result}%`;
} else {
return "-- No change in score --";
}
}
const commitString = job.commit ? job.commit : job.firstCommit ? job.firstCommit.slice(0, 10) + '..' + job.secondCommit.slice(0, 10) : job.good_commit.slice(0, 10) + '..' + job.bad_commit.slice(0, 10);
const backendString = job.platform == 'win32' && job.openGLBackend ? ` - Open GL Backend: ${job.openGLBackend}` : '';
var resultString = '';
......@@ -241,7 +251,7 @@ notifyJob.on('JobDone', function(){
resultString = `Results<br>
First commit result (${job.firstCommit.slice(0, 10)}): ${job.resultJSON.finalResults[0]}<br>
Second commit result (${job.secondCommit.slice(0, 10)}): ${job.resultJSON.finalResults[1]}<br>
Observed regression: ${job.resultJSON.finalResults[2]}%`;
${resultText(job.resultJSON.finalResults[2])}%`;
} else if (job.testType == 'bisect'){
const bisectResult = job.resultJSON.bisectResults[1].length > 1 ?
`Bisect returned multiple commits. This is probably due to skipped commits.<br>
......@@ -253,7 +263,7 @@ notifyJob.on('JobDone', function(){
resultString = `Results<br>
Good commit result (${job.good_commit.slice(0, 10)}): ${job.resultJSON.baselineResults[0]}<br>
Bad commit result (${job.bad_commit.slice(0, 10)}): ${job.resultJSON.baselineResults[1]}<br>
Observed regression: ${job.resultJSON.baselineResults[2]}%<br>
${resultText(job.resultJSON.baselineResults[2])}%<br>
${bisectResult}
Tested Commits raw results:<br>
${JSON.stringify(job.resultJSON.bisectResults[0], null, '&nbsp;').replace(/\n/g, '<br>')}<br><br>
......@@ -1384,6 +1394,16 @@ function homePage(req, res){
function jobFormatter(job){
// Dynamically format a job for display on the page
function resultText(result){
if(result < 0 ){
return `Observed improvement: ${Math.abs(result)}%`;
} else if (result > 0){
return `Observed regression: ${result}%`;
} else {
return "-- No change in score --";
}
}
const commitString = job.commit ? job.commit : job.firstCommit ? job.firstCommit.slice(0, 10) + '..' + job.secondCommit.slice(0, 10) : job.good_commit ? job.good_commit.slice(0, 10) + '..' + job.bad_commit.slice(0, 10) : '';
const backendString = job.platform == 'win32' && job.openGLBackend ? ` - Open GL Backend: ${job.openGLBackend}` : '';
var resultString = '';
......@@ -1393,7 +1413,7 @@ function homePage(req, res){
} else if (job.testType == 'twoCommit'){
resultString = `<b>Results: </b>First commit result (${job.firstCommit.slice(0, 10)}): ${job.resultJSON.finalResults[0]},
Second commit result (${job.secondCommit.slice(0, 10)}): ${job.resultJSON.finalResults[1]}<br>
Observed regression: ${job.resultJSON.finalResults[2]}%`;
${resultText(job.resultJSON.finalResults[2])}`;
}
if (job.testType == 'bisect'){
const bisectResult = job.resultJSON.bisectResults[1].length > 1 ?
......@@ -1404,7 +1424,7 @@ function homePage(req, res){
resultString = `<b>Results: </b>Good commit result (${job.good_commit.slice(0, 10)}): ${job.resultJSON.baselineResults[0]},
Bad commit result (${job.bad_commit.slice(0, 10)}): ${job.resultJSON.baselineResults[1]}<br>
Observed regression: ${job.resultJSON.baselineResults[2]}%<br>
${resultText(job.resultJSON.baselineResults[2])}<br>
${bisectResult}
`;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment