Devtools Timeline Parser
Used to extract meaning metrics from raw timeline data generated in Chrome Devtools.
Install
npm install devtools-timeline-parser
Usage
const Parser = require('devtools-timeline-parser');
const data = require('/path/to/raw/timeline/json/file');
const parser = new Parser(data);
parser.cpu();
parser.memory();
parser.frames();
const topDownRootNode = parser.topDown();
Parser.traverseTopDownTree(topDownRootNode, (node, depth) => {
if (node.selfTime >= 16 && node.selfTime !== Infinity) {
console.log({
id: node.id,
selfTime: node.selfTime,
totalTime: node.totalTime,
eventArgs: node.event.args,
});
}
});
Demo
# Run demo script
$ node examples/demo.js
# Then check generated CPU.json, Memory.json and Frames.json files
Thanks
This project heavily borrows ideas from a depreacted project devtools-timeline-model.
Potential blockers
But due to the uncompiled TypeScript files in latest chrome-devtools-frontend package, this repo still uses a legacy version 1.0.698043 of it.
License
MIT