Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Issue 441873007: Move timeline and importers to use telemetry.value.TraceValue (Closed)

Created:
6 years, 4 months ago by nduca
Modified:
5 years, 9 months ago
Reviewers:
nednguyen, chrishenry, slamm
CC:
chromium-reviews, telemetry+watch_chromium.org, tfarina
Project:
chromium
Visibility:
Public.

Description

Move timeline and importers to use telemetry.value.TraceValue This (admittedly massive) patch actually gives us an ubertrace object: the TraceValue. The key way to understand this CL is to read the trace.py file, then read importer.py. The rest is cosmetic fallout from the signature changes. A TraceValue contains the data from many tracers, and is always serializable. A TimelineModel is constructed from a single TimelineValue. Internally, a TraceValue is an in memory version of json of the following form: { traceEvents: ... inspectorTimelineEvnets: ... tabIds: ... } Since a TracedValue has all the tracer data, the model and importer system was updated so that instead of there being 1 importer per value, the importers instead indicate which part of the TraceValue they can handle, if any. BUG=356763

Patch Set 1 #

Total comments: 29
Unified diffs Side-by-side diffs Delta from patch set Stats (+874 lines, -909 lines) Patch
M tools/perf/measurements/image_decoding.py View 1 chunk +2 lines, -2 lines 0 comments Download
M tools/perf/measurements/smoothness_controller.py View 3 chunks +4 lines, -5 lines 0 comments Download
M tools/perf/measurements/timeline_controller.py View 1 chunk +1 line, -2 lines 0 comments Download
M tools/perf/metrics/speedindex_unittest.py View 5 chunks +18 lines, -13 lines 0 comments Download
M tools/telemetry/telemetry/core/backends/browser_backend.py View 1 chunk +1 line, -1 line 0 comments Download
M tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py View 3 chunks +6 lines, -9 lines 1 comment Download
M tools/telemetry/telemetry/core/backends/chrome/inspector_backend.py View 3 chunks +17 lines, -12 lines 0 comments Download
M tools/telemetry/telemetry/core/backends/chrome/inspector_network.py View 2 chunks +2 lines, -2 lines 0 comments Download
M tools/telemetry/telemetry/core/backends/chrome/inspector_timeline.py View 2 chunks +2 lines, -2 lines 0 comments Download
M tools/telemetry/telemetry/core/backends/chrome/tracing_backend.py View 4 chunks +13 lines, -20 lines 0 comments Download
M tools/telemetry/telemetry/core/backends/chrome/tracing_backend_unittest.py View 2 chunks +5 lines, -57 lines 0 comments Download
M tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler.py View 2 chunks +5 lines, -1 line 1 comment Download
M tools/telemetry/telemetry/core/platform/profiler/strace_profiler.py View 2 chunks +3 lines, -3 lines 0 comments Download
M tools/telemetry/telemetry/core/platform/profiler/trace_profiler.py View 2 chunks +4 lines, -2 lines 1 comment Download
M tools/telemetry/telemetry/core/platform/tracing_controller_backend.py View 2 chunks +4 lines, -4 lines 0 comments Download
M tools/telemetry/telemetry/core/tab_unittest.py View 2 chunks +4 lines, -4 lines 0 comments Download
M tools/telemetry/telemetry/page/actions/action_runner_unittest.py View 2 chunks +224 lines, -216 lines 1 comment Download
D tools/telemetry/telemetry/timeline/empty_timeline_data_importer.py View 1 chunk +0 lines, -27 lines 0 comments Download
D tools/telemetry/telemetry/timeline/empty_timeline_data_importer_unittest.py View 1 chunk +0 lines, -33 lines 0 comments Download
M tools/telemetry/telemetry/timeline/importer.py View 1 chunk +6 lines, -8 lines 1 comment Download
M tools/telemetry/telemetry/timeline/inspector_importer.py View 1 chunk +11 lines, -19 lines 0 comments Download
M tools/telemetry/telemetry/timeline/inspector_importer_unittest.py View 3 chunks +10 lines, -8 lines 0 comments Download
D tools/telemetry/telemetry/timeline/inspector_timeline_data.py View 1 chunk +0 lines, -21 lines 0 comments Download
M tools/telemetry/telemetry/timeline/model.py View 6 chunks +44 lines, -29 lines 1 comment Download
M tools/telemetry/telemetry/timeline/model_unittest.py View 1 chunk +13 lines, -6 lines 0 comments Download
A tools/telemetry/telemetry/timeline/tab_id_importer.py View 1 chunk +56 lines, -0 lines 2 comments Download
A tools/telemetry/telemetry/timeline/tab_id_importer_unittest.py View 1 chunk +72 lines, -0 lines 0 comments Download
D tools/telemetry/telemetry/timeline/timeline_data.py View 1 chunk +0 lines, -16 lines 0 comments Download
M tools/telemetry/telemetry/timeline/trace_event_importer.py View 3 chunks +13 lines, -101 lines 0 comments Download
M tools/telemetry/telemetry/timeline/trace_event_importer_unittest.py View 35 chunks +65 lines, -261 lines 0 comments Download
D tools/telemetry/telemetry/timeline/tracing_timeline_data.py View 1 chunk +0 lines, -22 lines 0 comments Download
A tools/telemetry/telemetry/value/trace.py View 1 chunk +194 lines, -0 lines 21 comments Download
A tools/telemetry/telemetry/value/trace_unittest.py View 1 chunk +72 lines, -0 lines 0 comments Download
M tools/telemetry/telemetry/web_perf/timeline_based_measurement.py View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
nduca
early preview. probably ready for review by Tuesday night.
6 years, 4 months ago (2014-08-05 12:22:34 UTC) #1
nduca
+otherned
6 years, 4 months ago (2014-08-05 12:23:51 UTC) #2
nednguyen
Looks solid to me. My only concern is I am not sure whether video can ...
6 years, 4 months ago (2014-08-05 14:34:34 UTC) #3
chrishenry
https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/value/trace.py File tools/telemetry/telemetry/value/trace.py (right): https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/value/trace.py#newcode30 tools/telemetry/telemetry/value/trace.py:30: class TraceValuePart(object): Just TracePart? TraceValuePart is a bit ambiguous. ...
6 years, 4 months ago (2014-08-05 23:44:16 UTC) #4
slamm
6 years, 4 months ago (2014-08-12 23:11:59 UTC) #5
Drive by.

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/co...
File tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py
(right):

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/co...
tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py:282:
self._tracing_backend.StopTracing(builder)
builder -> trace_value_builder ?

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/co...
File
tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler.py
(right):

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/co...
tools/telemetry/telemetry/core/platform/profiler/android_systrace_profiler.py:58:
self._browser_backend.StopTracing(builder)
builder -> trace_result_builder ?

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/co...
File tools/telemetry/telemetry/core/platform/profiler/trace_profiler.py (right):

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/co...
tools/telemetry/telemetry/core/platform/profiler/trace_profiler.py:35:
self._browser_backend.StopTracing(builder)
builder -> trace_result_builder

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/ti...
File tools/telemetry/telemetry/timeline/model.py (right):

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/ti...
tools/telemetry/telemetry/timeline/model.py:245: importers.sort(lambda k:
k.import_order)
Are you meaning to use cmp or key here?

importers.sort(key=lambda k: k.import_order)

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/ti...
File tools/telemetry/telemetry/timeline/tab_id_importer.py (right):

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/ti...
tools/telemetry/telemetry/timeline/tab_id_importer.py:36: # trace buffer
overflow.    for process in self._model.GetAllProcesses():
Missing newline.

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/ti...
tools/telemetry/telemetry/timeline/tab_id_importer.py:52:
assert(timeline_markers[0].start_thread ==
Needs line continuation.

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/va...
File tools/telemetry/telemetry/value/trace.py (right):

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/va...
tools/telemetry/telemetry/value/trace.py:63: part_field_names =
set([p.rawFieldName for p in ALL_TRACE_VALUE_PARTS])
You can build the set with a generator expression instead of a list:

part_field_names = set(p.rawFieldName for p in ALL_TRACE_VALUE_PARTS)

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/va...
tools/telemetry/telemetry/value/trace.py:104: self._raw_data == {}
self._raw_data = {} ?
Same in _TryInitFromRaw.

https://codereview.chromium.org/441873007/diff/1/tools/telemetry/telemetry/va...
tools/telemetry/telemetry/value/trace.py:107: if raw_data[0] == '[' and
raw_data[-1] != ']':
Better?

if raw_data.startswith('[') and not raw_data.endswith(']'):
  if raw_data.endswith(','):
    raw_data = raw_data[:-1]
  raw_data += ']'

Powered by Google App Engine
This is Rietveld 408576698