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

Issue 2661573003: Refactor TraceData to encapsulate internal traces' representation (Closed)

Created:
3 years, 10 months ago by nednguyen
Modified:
3 years, 10 months ago
CC:
catapult-reviews_chromium.org, telemetry-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
catapult
Visibility:
Public.

Description

Refactor TraceData to encapsulate internal traces' representation Changes to TraceData's API: + TraceData.Serialize() is the only supported way to serialize the traces to a single HTML trace file. The memory saving still comes from the fact that this uses the trace file handle directly if the trace were collected using TraceFileHandle (in chrome_inspector/tracing_backend.py). + TraceData.GetTracesFor only return traces in dictionary form, since one do not needs to call this unless they want to have access to the trace events in Python. Upon calling this, all the TraceFileHandle are also converted to the in-memory form automatically since there is no use in saving memory once this is invoked. As a result of this, no clients of TraceData need concern with whether the internal representation of trace is TraceFileHandle or the in-memory dictionary form. BUG=catapult:#3119 Review-Url: https://codereview.chromium.org/2661573003 Committed: https://chromium.googlesource.com/external/github.com/catapult-project/catapult/+/e1e303241a39f9ea96b99cfc6bb92b191c1f2b1e

Patch Set 1 #

Total comments: 6

Patch Set 2 : Style nits #

Total comments: 11

Patch Set 3 : Address Charlie's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -193 lines) Patch
M telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend_unittest.py View 3 chunks +2 lines, -13 lines 0 comments Download
M telemetry/telemetry/internal/platform/profiler/trace_profiler.py View 2 chunks +8 lines, -13 lines 0 comments Download
M telemetry/telemetry/internal/platform/profiler/trace_profiler_unittest.py View 2 chunks +2 lines, -7 lines 0 comments Download
M telemetry/telemetry/page/page_run_end_to_end_unittest.py View 1 chunk +1 line, -1 line 0 comments Download
M telemetry/telemetry/timeline/trace_data.py View 1 2 3 chunks +82 lines, -41 lines 0 comments Download
M telemetry/telemetry/timeline/trace_data_unittest.py View 1 2 1 chunk +11 lines, -27 lines 0 comments Download
M telemetry/telemetry/timeline/trace_event_importer.py View 2 chunks +0 lines, -20 lines 0 comments Download
M telemetry/telemetry/value/trace.py View 3 chunks +7 lines, -46 lines 0 comments Download
M telemetry/telemetry/value/trace_unittest.py View 2 chunks +0 lines, -2 lines 0 comments Download
M telemetry/telemetry/web_perf/timeline_based_measurement.py View 2 chunks +17 lines, -23 lines 0 comments Download

Messages

Total messages: 42 (32 generated)
nednguyen
3 years, 10 months ago (2017-02-01 21:41:40 UTC) #18
perezju
lgtm w/some comments https://codereview.chromium.org/2661573003/diff/60001/telemetry/telemetry/internal/platform/profiler/trace_profiler.py File telemetry/telemetry/internal/platform/profiler/trace_profiler.py (right): https://codereview.chromium.org/2661573003/diff/60001/telemetry/telemetry/internal/platform/profiler/trace_profiler.py#newcode49 telemetry/telemetry/internal/platform/profiler/trace_profiler.py:49: trace_result.Serialize(trace_file, trace_title=title) no more zip'ing? could ...
3 years, 10 months ago (2017-02-02 09:25:57 UTC) #22
nednguyen
https://codereview.chromium.org/2661573003/diff/60001/telemetry/telemetry/internal/platform/profiler/trace_profiler.py File telemetry/telemetry/internal/platform/profiler/trace_profiler.py (right): https://codereview.chromium.org/2661573003/diff/60001/telemetry/telemetry/internal/platform/profiler/trace_profiler.py#newcode49 telemetry/telemetry/internal/platform/profiler/trace_profiler.py:49: trace_result.Serialize(trace_file, trace_title=title) On 2017/02/02 09:25:56, perezju wrote: > no ...
3 years, 10 months ago (2017-02-02 14:00:22 UTC) #23
nednguyen
On 2017/02/02 14:00:22, nednguyen wrote: > https://codereview.chromium.org/2661573003/diff/60001/telemetry/telemetry/internal/platform/profiler/trace_profiler.py > File telemetry/telemetry/internal/platform/profiler/trace_profiler.py (right): > > https://codereview.chromium.org/2661573003/diff/60001/telemetry/telemetry/internal/platform/profiler/trace_profiler.py#newcode49 > ...
3 years, 10 months ago (2017-02-03 20:19:01 UTC) #28
charliea (OOO until 10-5)
https://codereview.chromium.org/2661573003/diff/80001/telemetry/telemetry/timeline/trace_data.py File telemetry/telemetry/timeline/trace_data.py (right): https://codereview.chromium.org/2661573003/diff/80001/telemetry/telemetry/timeline/trace_data.py#newcode85 telemetry/telemetry/timeline/trace_data.py:85: """ TraceData holds a collection of traces from multiple ...
3 years, 10 months ago (2017-02-04 00:43:29 UTC) #29
charliea (OOO until 10-5)
lgtm % my previous comments
3 years, 10 months ago (2017-02-04 00:43:47 UTC) #30
perezju
https://codereview.chromium.org/2661573003/diff/80001/telemetry/telemetry/timeline/trace_data_unittest.py File telemetry/telemetry/timeline/trace_data_unittest.py (right): https://codereview.chromium.org/2661573003/diff/80001/telemetry/telemetry/timeline/trace_data_unittest.py#newcode17 telemetry/telemetry/timeline/trace_data_unittest.py:17: test_temp_file = tempfile.NamedTemporaryFile(delete=False) On 2017/02/04 00:43:29, charliea wrote: > ...
3 years, 10 months ago (2017-02-06 09:21:22 UTC) #31
nednguyen
https://codereview.chromium.org/2661573003/diff/80001/telemetry/telemetry/timeline/trace_data.py File telemetry/telemetry/timeline/trace_data.py (right): https://codereview.chromium.org/2661573003/diff/80001/telemetry/telemetry/timeline/trace_data.py#newcode85 telemetry/telemetry/timeline/trace_data.py:85: """ TraceData holds a collection of traces from multiple ...
3 years, 10 months ago (2017-02-06 15:17:38 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2661573003/100001
3 years, 10 months ago (2017-02-06 15:18:05 UTC) #39
commit-bot: I haz the power
3 years, 10 months ago (2017-02-06 15:39:10 UTC) #42
Message was sent while issue was closed.
Committed patchset #3 (id:100001) as
https://chromium.googlesource.com/external/github.com/catapult-project/catapu...

Powered by Google App Engine
This is Rietveld 408576698