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

Unified Diff: tools/telemetry/telemetry/core/timeline/async_slice.py

Issue 19790005: Reland [telemetry] Timeline model cleanups (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
Index: tools/telemetry/telemetry/core/timeline/async_slice.py
diff --git a/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py b/tools/telemetry/telemetry/core/timeline/async_slice.py
similarity index 54%
rename from tools/telemetry/telemetry/core/timeline/tracing/async_slice.py
rename to tools/telemetry/telemetry/core/timeline/async_slice.py
index 03031c1e6e43bb5afdcd66c5444f37086507a965..140eadc651b7893e16c64b71b993b16b8e3e0514 100644
--- a/tools/telemetry/telemetry/core/timeline/tracing/async_slice.py
+++ b/tools/telemetry/telemetry/core/timeline/async_slice.py
@@ -2,20 +2,27 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import telemetry.core.timeline.tracing.slice as tracing_slice
+import telemetry.core.timeline.event as event
-class AsyncSlice(tracing_slice.Slice):
+class AsyncSlice(event.TimelineEvent):
''' A AsyncSlice represents an interval of time during which an
asynchronous operation is in progress. An AsyncSlice consumes no CPU time
itself and so is only associated with Threads at its start and end point.
'''
- def __init__(self, category, name, timestamp, args=None, parent=None):
+ def __init__(self, category, name, timestamp, args=None):
super(AsyncSlice, self).__init__(
- category, name, timestamp, args=args, parent=parent)
+ category, name, timestamp, duration=0, args=args)
+ self.parent_slice = None
self.start_thread = None
self.end_thread = None
+ self.sub_slices = []
self.id = None
def AddSubSlice(self, sub_slice):
- super(AsyncSlice, self).AddSubSlice(sub_slice)
- self.children.append(sub_slice)
+ assert sub_slice.parent_slice == self
+ self.sub_slices.append(sub_slice)
+
+
+ def IterEventsInThisContainerRecrusively(self):
+ for sub_slice in self.sub_slices:
+ yield sub_slice
« no previous file with comments | « tools/telemetry/telemetry/core/chrome/tracing_backend.py ('k') | tools/telemetry/telemetry/core/timeline/bounds.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698