Google Web Toolkit

Data Dump Format

In Speed Tracer you can press the 'save' button to dump the recorded instrumentation data out to disk. The data dump is a list of JSON objects, one per line. All messages have the following fields:

{
  type: <int type tag, see below>,
  time: <milliseconds since start of session>,
  data: {<JSON Dictionary of data specific to this event type>}
}

The following description is a human-readable listing of the data dump format. Note that you can view the JSON Schemas for these events in the speedhtracer source. The JSON schemas are considered the source of truth for the data dump format.

There are three general categories of records:

Browser Timeline Events

Timeline Events represent things running in the renderer's UI thread. Anything that takes a long time will block the UI thread and contribute to user-perceived sluggishness. Timeline events include actions such as layout, javascript execution, CSS selector matching, and others. A timeline event may contain multiple child events. The child events show where time is going in more detail. The format for a Timeline record is as follows:

{
  type: <Integer type tag>,
  time: <Number milliseconds since start of the session>,
  data: <JSON Dictionary of data specific to the type>
  ...
  [Optional Fields...]
  ...
  children: [<Timeline Event>, ... , <Timeline Event>],
  duration: <Number milliseconds this event took>,
  callerScriptName: <String URL of the script that triggered this event>,
  callerScriptLine: <Integer line from the calling script>,
  callerFunctionName: <String name of the function from the calling script>,
  usedHeapSize: <Integer size in bytes used in the heap>,
  totalHeapSize: <Integer total size in bytes of the heap>,
  sequence: <The sequence number of this event>,
}

The duration field includes the time spent in children. Each type of timeline event has different data available in the 'data' field.

DOM Event (DOM_EVENT)

An event representing the creation and dispatch of a DOM or Window level event (like a Click or DOMContentLoaded).

{
  type: 0,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    type: <String representation of DOM Event type>
  }
}

Layout (LAYOUT)

Indicates layout or reflow of the document.

{
  type: 1,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
  }
}

Recalculate Styles (RECALC_STYLE)

The renderer recalculated CSS styles. Style rules were rematched against the appropriate DOM elements.

{
  type: 2,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
  }
}

Paint (PAINT)

Indicates that some or part of the document was rasterized to the screen.

{
  type: 3,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    x: <Integer x-offset of area painted in pixels>,
    y: <Integer y-offset of area painted in pixels>,
    width: <Integer width of area painted in pixels>,
    height: <Integer height of area painted in pixels>
  }
}

Parse HTML (PARSE_HTML)

Indicates that the HTML tokenizer processed some of the document.

{
  type: 4,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    length: <Integer length in bytes of the parsed section>.
    startLine : <Integer line number of the beginning of the section>,
    endLine : <Integer line number of the end of the section>
  }
}

Timer Install (TIMER_INSTALLED)

Indicates that a timer was created through either a call to setTimeout() or setInterval(). This event should always be zero duration.

{
  type: 5,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    timerId: <String opaque ID identifying this timer>,
    singleShot: <Boolean true for a setTimeout() timer and false for a setInterval()>,
    timeout: <Integer timeout in milliseconds>,
  }
}

Timer Clear (TIMER_CLEARED)

Indicates that a timer was cancelled. This event should always be zero duration.

{
  type: 6,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    timerId: <String opaque ID identifying this timer>,
    singleShot: <Boolean true for a setTimeout() timer and false for a setInterval()>,
    timeout: <Integer timeout in milliseconds>,
  }
}

Timer (TIMER_FIRED)

Event corresponding to a timer fire.

{
  type: 7,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    timerId: <String opaque ID identifying this timer>
    singleShot: <Boolean true for a setTimeout() timer and false for a setInterval()>,
    timeout: <Integer timeout in milliseconds>,
  }
}

XHR Ready State Change (XHR_READY_STATE_CHANGE)

Indicates an XMLHttpRequest readystatechange event handler.

{
  type: 8,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    url: <String URL requested>,
    readyState: <1 | 2 | 3 | 4>
  }
}

XHR Load (XHR_LOAD)

Indicates an XMLHttpRequest load event handler.

{
  type: 9,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    url: <String URL requested>
  }
}

Eval Script (EVAL_SCRIPT)

Indicates that a <script> tag has been encountered, evaluated/compiled and run. In the case of <script src="http://website.com/...">, this event should also cover the time to download the script.

{
  type: 10,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    url: <String name of the tag's source>,
    lineNumber: <Integer start line of script contents within the document>
  }
}

Log Event (LOG_MESSAGE)

Indicates that there was a call to console.markTimeline() from within javascript on the monitored page.

{
  type: 11,
  time: <milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  children: [<Timeline Event>, ... , <Timeline Event>],
  data: {
    message: <String contents of message>
  }
}

Network Resource Start (NETWORK_RESOURCE_START)

Indicates a network request is enqueued.

{
  type: 12,
  time: <Number milliseconds since start of the session>, 
  data:  {
    identifier: <Integer id of this resource>,
    url: <URL requested>,
    requestMethod: <'GET' | 'POST' | ...>,
    isMainResource: <boolean whether this is a top level resource (page load)>,
  }
}

Network Resource Response (NETWORK_RESOURCE_RESPONSE)

Indicates that the renderer has started receiving bits from the resource loader. Note that this is NOT a network level time, but rather the timing from the perspective of the UI thread in the renderer. They usually align with network level timings, but if the UI thread is blocked doing work, this callback can be delayed.

{
  type: 13,
  time: <Number milliseconds since start of the session>,
  data:  {
    identifier: <Integer id>,
    expectedContentLength: <Integer the size in bytes that the browser expects the resource to be>,
    mimeType: <The MIME type of the resource>,
    statusCode: <Integer HTTP response code>,
  }
}

Network Resource Finished (NETWORK_RESOURCE_FINISH)

Indictes a resource load is successful and complete.

{
  type: 14,
  time: <Number milliseconds since start of the session>,
  data:  {
    identifier: <Integer id>
    didFail: <boolean whether or not the resource request failed>
  }
}

JavaScript Callback (JAVASCRIPT_CALLBACK)

This event covers the time spent running JavaScript during an event dispatch

{
  type: 15,
  time: <Number milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  data:  {
    scriptName: <String name of the script that contained this function>
    scriptLine: <Integer the line in the script where this function resides>
  }
}

Resource Data Received (RESOURCE_DATA_RECEIVED)

This is a parent event for processing data for any resource loaded from the resource loader (e.g. HTML pages, images, external scripts).

{
  type: 16,
  time: <Number milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  data:  {
    identifier: <Integer id>
  }
}

Garbage Collection Event (GC_EVENT)

Indicates some time was spent doing garbage collection.

{
  type: 17,
  time: <Number milliseconds since start of the session>,
  duration: <milliseconds this event took>,
  data:  {
    usedHeapSizeDelta: <Delta in size from the last GC event>
  }
}

Mark DOM Content (MARK_DOM_CONTENT)

Mark that the main resource DOM document finished parsing.

{
  type: 18,
  time: <Number milliseconds since start of the session>,
  data:  {
  }
}

Mark Load Event(MARK_LOAD_EVENT)

Mark that the main resource finished loading.

{
  type: 19,
  time: <Number milliseconds since start of the session>,
  data:  {
  }
}

Speed Tracer Event

Speed Tracer Events are events synthesized by speed tracer. These events usually indicate some change of state.

Tab Changed (TAB_CHANGED)

Indicates that there is a change in the location bar or title of the tab. You can use this record to detect a page transition.

{
  type: 0x7FFFFFFE, // MAX SIGNED 32 BIT INTEGER - 1
  time: <milliseconds since start of the session>,
  data:{
    url: <String new URL of the monitored tab>
  }
}

Network Resource Update (NETWORK_RESOURCE_UPDATE)

Record that updates information for a given network resource. These messages are sent intermittenly as the resource loader learns more information about a given network resource. Resource updates have a series of optional fields.

{
  type: 0x7FFFFFFD, // MAX SIGNED 32 BIT INTEGER - 2
  time: <Number milliseconds since start of the session>,
  data:  {
    identifier: <Integer id>
    ...
    [Series of optional fields listed below]
    ...
  }
}

Fields on a Network Resource Update are present according to the following conditions:
  • if (update.data.didRequestChange == true), then the following fields should exist:
        update.data.url
        update.data.documentURL
        update.data.host
        update.data.path
        update.data.lastPathComponent
        update.data.requestHeaders
        update.data.mainResource
        update.data.requestMethod
        update.data.requestFormData
        update.data.cached
        
  • if (update.data.didResponseChange == true), then the following fields should exist:.
        update.data.mimeType
        update.data.suggestedFilename
        update.data.expectedContentLength
        update.data.statusCode
        update.data.responseHeaders
        
  • if (update.data.didTypeChange == true), then the following fields should exist:
          update.data.type
          
  • if (update.data.didLengthChange == true), then the following fields should exist:
          update.data.resourceSize
          
  • if (update.data.didTimingChange == true), then the following fields MAY exist:
        update.data.startTime
        update.data.responseReceivedTime
        update.data.endTime
        update.data.loadEventTime
        update.data.domContentEventTime
        

NOTE**: There may be other undocumented fields present on a resource update.

Javascript Profile Information (PROFILE_DATA)

Record with javascript profiling information

{
  type: 0x7FFFFFFC, // MAX SIGNED 32 BIT INTEGER - 3
  time: <Number milliseconds since start of the session>,
  data:  {
    format: <String type of javascript profile data (e.g. 'v8')>,
    profileData: <String profile data>,
    isOrphaned: <Boolean true if it is an orphan, false if it belongs to a timeline event>
  }
}
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.