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

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

Issue 100073003: telemetry: Add thread time to telmetry timeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/core/timeline/event.py
diff --git a/tools/telemetry/telemetry/core/timeline/event.py b/tools/telemetry/telemetry/core/timeline/event.py
index 8b9db4cef72e082401be71fb0bf9ab3f32b591b9..47567c252a4ab426eaefce5db27b31cc1ed82569 100644
--- a/tools/telemetry/telemetry/core/timeline/event.py
+++ b/tools/telemetry/telemetry/core/timeline/event.py
@@ -4,25 +4,37 @@
class TimelineEvent(object):
"""Represents a timeline event."""
nduca 2013/12/03 07:18:55 can you put a docstring here to indicate that thre
ernstm 2013/12/03 20:55:54 Done.
- def __init__(self, category, name, start, duration, args=None):
+ def __init__(self, category, name, start, duration, thread_start=None,
+ thread_duration=None, args=None):
self.category = category
self.name = name
self.start = start
self.duration = duration
+ self.thread_start = thread_start
+ self.thread_duration = thread_duration
self.args = args
@property
def end(self):
return self.start + self.duration
+ @property
+ def thread_end(self):
nduca 2013/12/03 07:18:55 docstring ehre too
ernstm 2013/12/03 20:55:54 Done.
+ if self.thread_start == None or self.thread_duration == None:
+ return None
+ return self.thread_start + self.thread_duration
+
def __repr__(self):
if self.args:
args_str = ', ' + repr(self.args)
else:
args_str = ''
- return "TimelineEvent(name='%s', start=%f, duration=%s%s)" % (
- self.name,
- self.start,
- self.duration,
- args_str)
+ return ("TimelineEvent(name='%s', start=%f, duration=%s, " +
+ "thread_start=%s, thread_duration=%s%s)") % (
+ self.name,
+ self.start,
+ self.duration,
+ self.thread_start,
+ self.thread_duration,
+ args_str)

Powered by Google App Engine
This is Rietveld 408576698