Skip to content

Instantly share code, notes, and snippets.

@sdwilsh
Created May 13, 2011 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdwilsh/971090 to your computer and use it in GitHub Desktop.
Save sdwilsh/971090 to your computer and use it in GitHub Desktop.
Generates csv output for the runs
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