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

Unified Diff: telemetry/telemetry/timeline/trace_event_importer.py

Issue 2661573003: Refactor TraceData to encapsulate internal traces' representation (Closed)
Patch Set: Address Charlie's comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « telemetry/telemetry/timeline/trace_data_unittest.py ('k') | telemetry/telemetry/value/trace.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/timeline/trace_event_importer.py
diff --git a/telemetry/telemetry/timeline/trace_event_importer.py b/telemetry/telemetry/timeline/trace_event_importer.py
index c909fb2a67fda5ce7ef0661f3f8450527b983119..e75b19ab8bc316fa4b6e040dbc6afd103355f404 100644
--- a/telemetry/telemetry/timeline/trace_event_importer.py
+++ b/telemetry/telemetry/timeline/trace_event_importer.py
@@ -9,7 +9,6 @@ https://code.google.com/p/trace-viewer/
import collections
import copy
-import json
import telemetry.timeline.async_slice as tracing_async_slice
import telemetry.timeline.flow_event as tracing_flow_event
@@ -33,25 +32,6 @@ class TraceEventTimelineImporter(importer.TimelineImporter):
self._events = []
self._metadata = []
for trace in trace_data.GetTracesFor(trace_data_module.CHROME_TRACE_PART):
- if isinstance(trace, trace_data_module.TraceFileHandle):
- trace_handle = trace
- file_path = trace_handle.file_path
- try:
- with open(file_path, 'r') as f:
- trace = json.load(f)
- finally:
- # HACK: during the effort of converting chrome trace's representation
- # from in-memory to disk, we need to either:
- # 1) Audit all the clients of python trace importer to explictly
- # cleaned up the trace handle after use.
- # 2) Clean up the trace handle for them.
- # We decide to clean up the trace handle for them here (option 2) as
- # it's lots of work to fix all the call sites. Once all the trace
- # converting code are converted to use the Javascript engine, this
- # problem also goes away as we only have a single trace parser
- # engine.
- # https://bugs.chromium.org/p/chromium/issues/detail?id=682355
- trace_handle.Clean()
self._events.extend(trace['traceEvents'])
self.CollectMetadataRecords(trace)
« no previous file with comments | « telemetry/telemetry/timeline/trace_data_unittest.py ('k') | telemetry/telemetry/value/trace.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698