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

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

Issue 100073003: telemetry: Add thread time to telmetry timeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean-ups 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/model.py
diff --git a/tools/telemetry/telemetry/core/timeline/model.py b/tools/telemetry/telemetry/core/timeline/model.py
index 762ddb15f1362ae5ee3431bca74f2fb738631fbd..7514c342eb7f0afa8f2f785f648c79f984fc215a 100644
--- a/tools/telemetry/telemetry/core/timeline/model.py
+++ b/tools/telemetry/telemetry/core/timeline/model.py
@@ -40,6 +40,7 @@ class MarkerOverlapError(Exception):
class TimelineModel(object):
def __init__(self, event_data=None, shift_world_to_zero=True):
self._bounds = bounds.Bounds()
+ self._thread_time_bounds = bounds.Bounds()
self._processes = {}
self._frozen = False
self.import_errors = []
@@ -57,6 +58,10 @@ class TimelineModel(object):
return self._bounds
@property
+ def thread_time_bounds(self):
+ return self._thread_time_bounds
+
+ @property
def processes(self):
return self._processes
@@ -77,7 +82,8 @@ class TimelineModel(object):
self.UpdateBounds()
if not self.bounds.is_empty:
for process in self._processes.itervalues():
- process.AutoCloseOpenSlices(self.bounds.max)
+ process.AutoCloseOpenSlices(self.bounds.max,
+ self.thread_time_bounds.max)
for importer in importers:
importer.FinalizeImport()
@@ -97,15 +103,23 @@ class TimelineModel(object):
self.UpdateBounds()
if self._bounds.is_empty:
return
- shift_amount = -self._bounds.min
+ shift_amount = self._bounds.min
+ thread_shift_amount = self._thread_time_bounds.min
for event in self.IterAllEvents():
- event.start += shift_amount
+ event.start -= shift_amount
+ if event.thread_start != None:
+ event.thread_start -= thread_shift_amount
def UpdateBounds(self):
self._bounds.Reset()
+ self._thread_time_bounds.Reset()
for event in self.IterAllEvents():
self._bounds.AddValue(event.start)
self._bounds.AddValue(event.end)
+ if event.thread_start != None:
+ self._thread_time_bounds.AddValue(event.thread_start)
+ if event.thread_end != None:
+ self._thread_time_bounds.AddValue(event.thread_end)
def GetAllContainers(self):
containers = []
« no previous file with comments | « tools/telemetry/telemetry/core/timeline/inspector_importer.py ('k') | tools/telemetry/telemetry/core/timeline/process.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698