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
// If running this from Scratchpad, the context must be https://hg.mozilla.org/
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 = [];
let csetMap = {};
for (let i = 0; i < changesets.length; i++) {
let cset = changesets[i];
let data = result[cset]["tp4"].test_runs;
// Get the m-c changeset for this push.
req.open("GET", "https://hg.mozilla.org/try/json-family?node=" + cset, false);
req.send(null);
changesets[i] = JSON.parse(req.responseText).nodes[0].parents[0].slice(0, 12);
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