Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/traceviewify
Converts .cpuprofile format to trace viewer JSON object format to allow analysing the data in chrome://tracing.
https://github.com/thlorenz/traceviewify
Last synced: about 1 month ago
JSON representation
Converts .cpuprofile format to trace viewer JSON object format to allow analysing the data in chrome://tracing.
- Host: GitHub
- URL: https://github.com/thlorenz/traceviewify
- Owner: thlorenz
- License: mit
- Created: 2015-02-02T02:10:27.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-06T23:32:15.000Z (almost 10 years ago)
- Last Synced: 2024-10-21T03:15:36.579Z (2 months ago)
- Language: JavaScript
- Homepage: http://thlorenz.github.io/traceviewify/
- Size: 2.23 MB
- Stars: 55
- Watchers: 5
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# traceviewify [![build status](https://secure.travis-ci.org/thlorenz/traceviewify.png)](http://travis-ci.org/thlorenz/traceviewify)
[![testling badge](https://ci.testling.com/thlorenz/traceviewify.png)](https://ci.testling.com/thlorenz/traceviewify)
Converts `.cpuprofile` format to trace viewer [JSON object
format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit#heading=h.q8di1j2nawlp) to allow analysing the data in chrome://tracing.```js
var traceviewify = require('traceviewify');
var cpuprofile = require('./fixtures/fibonacci.cpuprofile');var traceviewObjectFormat = traceviewify(cpuprofile);
```[live demo](http://thlorenz.github.io/traceviewify/)
## Screenshots
[![screenshot](assets/traceview.png)](http://thlorenz.github.io/traceviewify/)
*The screenshot above shows [chrome://tracing](chrome://tracing) timeline and sunburst of traceviewified data*
![screenshot](assets/cpuprofile.png)
*The screenshot above shows DevTools with `.cpuprofile` from which the traceview was generated*
## Usage
```
cat some.cpuprofile | traceviewify > trace.json
```Then load it into [chrome://tracing](chrome://tracing).
## Installation
npm install traceviewify
## DTrace
A [simple DTrace script](https://github.com/thlorenz/traceviewify/blob/master/tools/trace_entry_return.d) was also added
which generates trace viewer events. The resulting JSON can be directly imported into
[chrome://tracing](chrome://tracing).## API
traceviewify(cpuprofile, opts) → {Object}Converts given cpuprofile object to a trace viewer JSON object.
Parameters:
Name
Type
Argument
Description
cpuprofile
Object
as produced by Chrome DevTools or cpuprofilify
opts
Object
<optional>
Properties
Name
Type
Description
pid
number
sets process id
tid
number
sets thread id
cpu
number
sets CPU number
Returns:
trace viewer JSON object
Type
Object*generated with [docme](https://github.com/thlorenz/docme)*
## License
MIT