Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sitespeedio/chrome-trace
Process Chrome trace logs in Node.
https://github.com/sitespeedio/chrome-trace
chrome devtools tracelog webperf
Last synced: 3 months ago
JSON representation
Process Chrome trace logs in Node.
- Host: GitHub
- URL: https://github.com/sitespeedio/chrome-trace
- Owner: sitespeedio
- Created: 2018-04-08T09:22:07.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T19:49:29.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T21:43:08.041Z (10 months ago)
- Topics: chrome, devtools, tracelog, webperf
- Language: JavaScript
- Homepage:
- Size: 1.4 MB
- Stars: 15
- Watchers: 5
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Chrome-trace
[![Build status][travis-image]][travis-url]
Analyze tracelogs from Chrome, from the command line or as a node.js library.
## How to use
### Command line
With node.js >= 8.9 and npm >= 5.3, use npx to run chrome-trace.
```
npx chrome-trace
```### node.js
Install chrome-trace as a dependency.
```sh
npm i chrome-trace
```
Pass a stream or a parsed JSON object to chrome-trace.
```javascript
const { parseStream } = require('chrome-trace');const stream = getReadableStream(); // e.g. stream from file or http response
const parsedTrace = parseStream(stream);const mainThreadId = parsedTrace.mainThread;
const categories = parsedTrace.eventCategoryTime[mainThreadId];
console.log(categories);
```## Development
* The format for trace-log events is described [here][event-format].
* A [python parser][trace-parser] for tracelogs is available from WPO Foundation.
* Chrome-trace uses [Ava] for testing. Please run ```npm run test``` before submitting PRs.
* Code formatting by [Prettier]. Please run ```npm run lint:fix``` before submitting PRs.
* Optional verbose logging using the [debug] module.
* Additional useful npm scripts are:
* ```test:verbose``` for additional debug info
* ```test:watch``` to rerun tests as changes are made
* ```test:watch:verbose``` automatic testing, with debug output[travis-image]: https://img.shields.io/travis/sitespeedio/chrome-trace.svg?style=flat-square
[travis-url]: https://travis-ci.org/sitespeedio/chrome-trace
[Prettier]: https://prettier.io
[Ava]: https://ava.li
[debug]: https://github.com/visionmedia/debug
[event-format]: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU
[trace-parser]: https://github.com/WPO-Foundation/trace-parser