Skip to content

⏱️Collect meaningful metrics from Chrome's trace events.

License

Notifications You must be signed in to change notification settings

speedracer/speedmetrics

Repository files navigation

Speedmetrics

travis codecov

Collect meaningful metrics from Chrome's trace events.

Quickstart

Installation

npm install speedmetrics

Usage

import collectMetrics from 'speedmetrics'

const metrics = await collectMetrics(trace.traceEvents)
console.log(metrics)
{
  timings: {
    navigationStart: 0,
    domContentLoaded: 200,
    firstPaint: 400,
    firstContentfulPaint: 400,
    firstMeaningfulPaint: 600,
    load: 1000
  }
  events: {
    /* ... */
  }
}

API

collectMetrics(traceEvents)

Accepts a trace events object and return collected metrics.

readFile('trace.json', 'utf8', async (err, data) => {
  const metrics = await collectMetrics(data.traceEvents)
})

About

⏱️Collect meaningful metrics from Chrome's trace events.

Resources

License

Stars

Watchers

Forks

Packages

No packages published