Google Web Toolkit

Speed Tracer Logging API

Correlating application-level user interactions with regions in the graph can be difficult, especially with applications that have a high level of activity. The Speed Tracer Logging API provides a means for you to insert markers throughout your application that will show up on the Speed Tracer timeline. The log messages are captured in the event trace tree and highlighted with an icon, so you can know exactly when the message was logged with respect to the other things going on in the browser.

Speed Tracer uses WebKit's console logging API to record the log in the stream of timeline data.

window.console.markTimeline("String");

The following is the suggested usage for regular JS applications:

function log(msg) {
  var logger = window.console;
  if (logger && logger.markTimeline) {
    logger.markTimeline(msg);
  }
}

The following is the suggested usage for GWT applications:

public static native void log(String msg) /*-{
  var logger = $wnd.console;
  if(logger && logger.markTimeline) {
    logger.markTimeline(msg); 
  }
}-*/;  

Invocations of console.markTimeline() show up in timeline's Event Trace, annotated with a little blue info bubble , at the beginning of the highlighted "Log message":

The log message will also be a part of any Speed Traces you save to disk. A saved Speed Trace JSON record looks like the following:

{
  "type":11,
  "data":{"message":"Building Widget A"},
    "time":2053.023000001907,
    "duration":0.003099958515167236,
    "children":[]
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.