Skip to content

liweiwang1993/devtools-timeline-model

 
 

Repository files navigation

devtools-timeline-model Build Status

Parse raw trace data into the Chrome DevTools' structured profiling data models

If you use something like big-rig or automated-chrome-profiling you may end up with raw trace data. It's pretty raw. This module will parse that stuff into something a bit more consumable, and should help you with higher level analysis.

Install

$ npm install --save devtools-timeline-model

NPM devtools-timeline-model package

Usage

const filename = 'demo/mdn-fling.json'

var fs = require('fs')
var events = fs.readFileSync(filename, 'utf8')
const devtoolsTimelineModel = require('devtools-timeline-model');
var model = devtoolsTimelineModel(events)

//=>
model.timelineModel // full event tree
model.irModel // interactions, input, animations
model.frameModel // frames, durations
model.filmStripModel // screenshots

image

Using devtool to view the full output: image

API

devtoolsTimelineModel(traceData)

traceData

Type: string or object

Either a string of the trace data or the JSON.parse'd equivalent.

return object model

  • model.timelineModel full event tree
  • model.irModel interactions, input, animations
  • model.frameModel frames, durations
  • model.filmStripModel screenshots

These objects are huge. You'll want to explore them in a UI like devtool.

License

Apache © Paul Irish

About

Parse raw trace data into the Chrome DevTools' structured profiling data models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%