simplabs/chrome-tracing

Name: chrome-tracing

Owner: simplabs

Description: null

Created: 2016-07-30 12:04:58.0

Updated: 2018-04-06 00:03:09.0

Pushed: 2016-08-01 20:12:50.0

Homepage: null

Size: 198

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

chrome-tracing

Chrome tracing allows you to automate Chrome benchmarking. It's goal is to provide a JavaScript variant of Telemetry.

Basic Usage

The most basic benchmark is the InitialRenderBenchmark.

rt { InitialRenderBenchmark } from "chrome-tracing";

benchmark = new InitialRenderBenchmark({
me: "app initial render",
l: "http://localhost:4200/",
dMarker: "renderEnd",
owser: {
type: "canary"



hmark.run().then((result) => {
nsole.log(result);
atch((err) => {
nsole.error(err);
ocess.exit(1);

In the app you must place a marker to let Chrome Tracing know that you are done rendering. This is done by using a performance.mark function call.

tion endTrace() {
 just before paint
questAnimationFrame(function () {
// after paint
requestAnimationFrame(function () {
  document.location.href = "about:blank";
});
;


erMyApp();
ormance.mark("renderEnd");
race();

In the example above we would mark right after we render the app and then call an endTrace function that ensures that we schedule a micro-task after paint that transitions to a blank page. Internally Chrome-Tracing will see this as the queue to start a new sample.

Extending Benchmarks

TODO


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.