Created
May 13, 2011 18:55
-
-
Save sdwilsh/971090 to your computer and use it in GitHub Desktop.
Generates csv output for the runs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let changesets = [ | |
]; | |
let url = "http://graphs.mozilla.org/api/test/runs/revisions?" + changesets.map(function(cset) { | |
return "revision=" + cset; | |
}).join("&"); | |
let req = new XMLHttpRequest(); | |
req.open("GET", url, false); | |
req.send(null); | |
let result = JSON.parse(req.responseText).revisions; | |
let winxp = []; | |
let win7 = []; | |
changesets.forEach(function(cset) { | |
let data = result[cset]["tp4"].test_runs; | |
if (data["WINNT 5.1"]) { | |
let tot = 0; | |
data["WINNT 5.1"].forEach(function(run) { tot += run[3]; }); | |
winxp.push(Math.round(tot / data["WINNT 5.1"].length)); | |
} | |
else { | |
winxp.push(undefined); | |
} | |
if (data["WINNT 6.1"]) { | |
let tot = 0; | |
data["WINNT 6.1"].forEach(function(run) tot += run[3]); | |
win7.push(Math.round(tot / data["WINNT 6.1"].length)); | |
} | |
else { | |
win7.push(undefined); | |
} | |
}); | |
let str = []; | |
for (let i = 0; i < changesets.length; i++) { | |
str.push([changesets[i], winxp[i], win7[i]].join(", ")); | |
} | |
str.join("\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment