Skip to content

Instantly share code, notes, and snippets.

@bgrins
Created December 1, 2017 18:05
Show Gist options
  • Save bgrins/ba5cfda83a77397cd10d33de808052bc to your computer and use it in GitHub Desktop.
Save bgrins/ba5cfda83a77397cd10d33de808052bc to your computer and use it in GitHub Desktop.
// https://treeherder.mozilla.org/#/jobs?repo=try&revision=aaccf2c1ff6b66b52bcfa1390b78bb781b86f672&filter-tier=1&filter-tier=2&filter-tier=3&selectedJob=148874008
var fs = require("fs");
var bsplit = require('buffer-split');
function readLines(path) {
const buf = fs.readFileSync(path); // omitting encoding returns a Buffer
const delim = Buffer.from('\n');
const result = bsplit(buf, delim);
return result
.filter(x => x.toString().indexOf("SetBoundElement") > -1)
.map(x => x.toString().match(/SetBoundElement Called (.+)/)[1]);
}
var lines = readLines('live_backing.log');
var obj = {}
for (var line of lines) {
obj[line] = obj[line] ? obj[line] + 1 : 1;
}
console.log(obj);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment