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

Unified Diff: tools/telemetry/telemetry/core/timeline/slice_unittest.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
« no previous file with comments | « tools/telemetry/telemetry/core/timeline/slice.py ('k') | tools/telemetry/telemetry/core/timeline/thread.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/timeline/slice_unittest.py
diff --git a/tools/telemetry/telemetry/core/timeline/slice_unittest.py b/tools/telemetry/telemetry/core/timeline/slice_unittest.py
index e2d6b822700e159e6943fa31dd81188659be74f0..8a75f0b46a9ac8bc440ae61de051843f34a6af72 100644
--- a/tools/telemetry/telemetry/core/timeline/slice_unittest.py
+++ b/tools/telemetry/telemetry/core/timeline/slice_unittest.py
@@ -11,10 +11,14 @@ class SliceTest(unittest.TestCase):
# [ top ]
# [ a ] [ b ]
# [x]
- top = Slice(None, 'cat', 'top', 0, duration=10)
- a = Slice(None, 'cat', 'a', 1, duration=2)
- x = Slice(None, 'cat', 'x', 1.5, duration=0.25)
- b = Slice(None, 'cat', 'b', 5, duration=2)
+ top = Slice(None, 'cat', 'top', 0, duration=10, thread_timestamp=0,
+ thread_duration=5)
+ a = Slice(None, 'cat', 'a', 1, duration=2, thread_timestamp=0.5,
+ thread_duration=1)
+ x = Slice(None, 'cat', 'x', 1.5, duration=0.25, thread_timestamp=0.75,
+ thread_duration=0.125)
+ b = Slice(None, 'cat', 'b', 5, duration=2, thread_timestamp=None,
+ thread_duration=None)
top.sub_slices.extend([a, b])
a.sub_slices.append(x)
@@ -23,4 +27,8 @@ class SliceTest(unittest.TestCase):
self.assertEquals(x.self_time, 0.25)
self.assertEquals(a.self_time, 1.75) # 2 - 0.25
- self.assertEquals(top.self_time, 6) # 10 - 2 -2
+ self.assertEquals(top.self_time, 6) # 10 - 2 - 2
+
+ self.assertEquals(x.self_thread_time, 0.125)
+ self.assertEquals(a.self_thread_time, 0.875) # 1 - 0.125
+ self.assertEquals(top.self_thread_time, None) # b has no thread time
« no previous file with comments | « tools/telemetry/telemetry/core/timeline/slice.py ('k') | tools/telemetry/telemetry/core/timeline/thread.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698