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

Unified Diff: tools/telemetry/telemetry/timeline/inspector_importer.py

Issue 814813003: Added test that SurfaceFlinger metrics are calculated on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: PLEASE IGNORE: accidentally uploaded to wrong issue Created 6 years 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
Index: tools/telemetry/telemetry/timeline/inspector_importer.py
diff --git a/tools/telemetry/telemetry/timeline/inspector_importer.py b/tools/telemetry/telemetry/timeline/inspector_importer.py
index 5f0e2490a75399fb1731d619cd894e68aa9a0b06..e99694271b2d8764f24075b4bf8a1438db09a9a2 100644
--- a/tools/telemetry/telemetry/timeline/inspector_importer.py
+++ b/tools/telemetry/telemetry/timeline/inspector_importer.py
@@ -6,33 +6,24 @@
import telemetry.timeline.slice as tracing_slice
import telemetry.timeline.thread as timeline_thread
from telemetry.timeline import importer
-from telemetry.timeline import inspector_timeline_data
+from telemetry.timeline import trace_data as trace_data_module
class InspectorTimelineImporter(importer.TimelineImporter):
- def __init__(self, model, timeline_data):
- super(InspectorTimelineImporter, self).__init__(model, timeline_data)
+ def __init__(self, model, trace_data):
+ super(InspectorTimelineImporter, self).__init__(model,
+ trace_data,
+ import_order=1)
+ self._events = trace_data.GetEventsFor(
+ trace_data_module.INSPECTOR_TRACE_PART)
@staticmethod
- def CanImport(timeline_data):
- ''' Checks if timeline_data is from the inspector timeline. We assume
- that if the first event is a valid inspector event, we can import the
- entire list.
- '''
- if not isinstance(timeline_data,
- inspector_timeline_data.InspectorTimelineData):
- return False
-
- event_data = timeline_data.EventData()
-
- if isinstance(event_data, list) and len(event_data):
- event_datum = event_data[0]
- return 'startTime' in event_datum and 'type' in event_datum
- return False
+ def GetSupportedPart():
+ return trace_data_module.INSPECTOR_TRACE_PART
def ImportEvents(self):
render_process = self._model.GetOrCreateProcess(0)
- for raw_event in self._timeline_data.EventData():
+ for raw_event in self._events:
thread = render_process.GetOrCreateThread(raw_event.get('thread', 0))
InspectorTimelineImporter.AddRawEventToThreadRecursive(thread, raw_event)
« no previous file with comments | « tools/telemetry/telemetry/timeline/importer.py ('k') | tools/telemetry/telemetry/timeline/inspector_importer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698