tracealyzer
Advanced tools
Comparing version 0.9.1 to 0.9.2
{ | ||
"name": "tracealyzer", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "A small package that reads Chrome trace files and outputs relevant information and statistics", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,5 +6,3 @@ # Tracealyzer | ||
## Example output | ||
## Example usage | ||
``` | ||
{ | ||
@@ -94,5 +92,28 @@ "profiling": { | ||
} | ||
``` | ||
## Example usage | ||
``` | ||
const puppeteer = require('puppeteer'); | ||
const tracealyzer = require('tracealyzer'); | ||
const TRACE_FILE = 'test/data/trace.json'; | ||
(async () => { | ||
const browser = await puppeteer.launch(); | ||
const page = await browser.newPage(); | ||
await page.tracing.start({path: TRACE_FILE}); | ||
await page.goto('https://www.wired.com'); | ||
await page.tracing.stop(); | ||
await browser.close(); | ||
const metrics = tracealyzer(TRACE_FILE); | ||
// do something with fx. metrics.rendering.fps.mean | ||
})(); | ||
``` | ||
### Credits | ||
This project is heavily inspired (and some of the code is even copied verbatim) by ngryman/speedracer. |
11741
117