cpuprofile

0.1.1 • Public • Published

cpuprofile

A simple representation of .cpuprofile files.

Installation

npm install --save cpuprofile

Usage

const Profile = require('cpuprofile').Profile;
 
// read and parse a .cpuprofile file
let content = require('fs').readFileSync('prof.cpuprofile', {encoding: 'utf8'});
let parsed = JSON.parse(content);
 
// create Profile
let profile = Profile.createFromObject(parsed);
 
// generate formatted overview on self and total times
let output = profile.formattedBottomUpProfile();

Features

  • Profile and ProfileNode classes.
  • Generation of Bottom Up Profiling view of Chrome DevTools.

Credits

  • Alexei Filippov: Thanks for pointing me in the right direction!
  • Chromium: The calculation of self and total times is adapted from parts of the Chromium project.

License

Copyright © 2016 by Sebastian Ruhleder. Released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i cpuprofile

Weekly Downloads

2

Version

0.1.1

License

MIT

Last publish

Collaborators

  • ruhleder