telemetry.timeline.trace_data | index telemetry/timeline/trace_data.py

`# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.`

Modules
`` |  |

json |  |  |

Classes
`` |  |

__builtin__.object
  TraceData
  TraceDataBuilder
  TraceDataPart
exceptions.Exception(exceptions.BaseException)
  NonSerializableTraceData

class NonSerializableTraceData(exceptions.Exception)
`` | `Raised when raw trace data cannot be serialized to TraceData.`

Method resolution order:
  NonSerializableTraceData
  exceptions.Exception
  exceptions.BaseException
  __builtin__.object

Data descriptors defined here:

__weakref__
  `list of weak references to the object (if defined)`

Methods inherited from exceptions.Exception:

__init__(...)
  `x.__init__(...) initializes x; see help(type(x)) for signature`

Data and other attributes inherited from exceptions.Exception:

__new__ = <built-in method __new__ of type object>
  `T.__new__(S, ...) -> a new object with type S, a subtype of T`

Methods inherited from exceptions.BaseException:

__delattr__(...)
  `x.__delattr__('name') <==> del x.name`

__getattribute__(...)
  `x.__getattribute__('name') <==> x.name`

__getitem__(...)
  `x.__getitem__(y) <==> x[y]`

__getslice__(...)
  `x.__getslice__(i, j) <==> x[i:j]
  Use of negative indices is not supported.`

__reduce__(...)

__repr__(...)
  `x.__repr__() <==> repr(x)`

__setattr__(...)
  `x.__setattr__('name', value) <==> x.name = value`

__setstate__(...)

__str__(...)
  `x.__str__() <==> str(x)`

__unicode__(...)

Data descriptors inherited from exceptions.BaseException:

__dict__

args

message

class TraceData(__builtin__.object)
`` | `Validates, parses, and serializes raw data. NOTE: raw data must only include primitive objects! By design, TraceData must contain only data that is BOTH json-serializable to a file, AND restorable once again from that file into TraceData without assistance from other classes.
Raw data can be one of three standard trace_event formats:
1. Trace container format: a json-parseable dict.
2. A json-parseable array: assumed to be chrome trace data.
3. A json-parseable array missing the final ']': assumed to be chrome trace
data.
`
| Methods defined here:

GetEventsFor(self, part)

HasEventsFor(self, part)

Serialize(self, f, gzip_result=False)
  `Serializes the trace result to a file-like object.
  Always writes in the trace container format.`

__init__(self, raw_data=None)
  `Creates TraceData from the given data.`

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

active_parts

events_are_safely_mutable
  `Returns true if the events in this value are completely sealed.
  Some importers want to take complex fields out of the TraceData and add
  them to the model, changing them subtly as they do so. If the TraceData
  was constructed with data that is shared with something outside the trace
  data, for instance a test harness, then this mutation is unexpected. But,
  if the values are sealed, then mutating the events is a lot faster.
  We know if events are sealed if the value came from a string, or if the
  value came from a TraceDataBuilder.`

metadata_records

class TraceDataBuilder(__builtin__.object)
`` | `TraceDataBuilder helps build up a trace from multiple trace agents. TraceData is supposed to be immutable, but it is useful during recording to have a mutable version. That is TraceDataBuilder.`
| Methods defined here:

AddEventsTo(self, part, events)
  `Note: this won't work when called from multiple browsers.
  Each browser's trace_event_impl zeros its timestamps when it writes them
  out and doesn't write a timebase that can be used to re-sync them.`

AsData(self)

HasEventsFor(self, part)

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class TraceDataPart(__builtin__.object)
`` | `TraceData can have a variety of events. These are called "parts" and are accessed by the following fixed field names.`
| Methods defined here:

__init__(self, raw_field_name)

__repr__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

raw_field_name

Data
`` |  | ALL_TRACE_PARTS = set([TraceDataPart("traceEvents"), TraceDataPart("inspectorTimelineEvents"), TraceDataPart("surfaceFlinger"), TraceDataPart("tabIds")]) CHROME_TRACE_PART = TraceDataPart("traceEvents") INSPECTOR_TRACE_PART = TraceDataPart("inspectorTimelineEvents")
SURFACE_FLINGER_PART = TraceDataPart("surfaceFlinger")
TAB_ID_PART = TraceDataPart("tabIds")