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

Side by Side Diff: tools/perf/measurements/task_execution_time.py

Issue 809393002: Added support for improvement_direction to relevant values, which is propogated to chartjson. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from telemetry.core.platform import tracing_category_filter 5 from telemetry.core.platform import tracing_category_filter
6 from telemetry.core.platform import tracing_options 6 from telemetry.core.platform import tracing_options
7 from telemetry.timeline.model import TimelineModel 7 from telemetry.timeline.model import TimelineModel
8 from telemetry.page import page_test 8 from telemetry.page import page_test
9 from telemetry.util import statistics 9 from telemetry.util import statistics
10 from telemetry.value import scalar 10 from telemetry.value import scalar
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 sorted_tasks = sorted(tasks, 50 sorted_tasks = sorted(tasks,
51 key=lambda slice: slice.median_self_duration, reverse=True) 51 key=lambda slice: slice.median_self_duration, reverse=True)
52 52
53 for task in sorted_tasks[:self.GetExpectedResultCount()]: 53 for task in sorted_tasks[:self.GetExpectedResultCount()]:
54 results.AddValue(scalar.ScalarValue( 54 results.AddValue(scalar.ScalarValue(
55 results.current_page, 55 results.current_page,
56 task.key, 56 task.key,
57 'ms', 57 'ms',
58 task.median_self_duration, 58 task.median_self_duration,
59 description = 'Slowest tasks')) 59 description = 'Slowest tasks',
60 higher_is_better=False))
60 61
61 @staticmethod 62 @staticmethod
62 def GetTasks(process): 63 def GetTasks(process):
63 task_dictionary = {} 64 task_dictionary = {}
64 depth = 1 65 depth = 1
65 for parent, task_slice in enumerate( 66 for parent, task_slice in enumerate(
66 process.IterAllSlicesOfName('MessageLoop::RunTask')): 67 process.IterAllSlicesOfName('MessageLoop::RunTask')):
67 ProcessTasksForSlice(task_dictionary, task_slice, depth, parent) 68 ProcessTasksForSlice(task_dictionary, task_slice, depth, parent)
68 # Return dictionary flattened into a list 69 # Return dictionary flattened into a list
69 return task_dictionary.values() 70 return task_dictionary.values()
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if key in dictionary: 118 if key in dictionary:
118 dictionary[key].Update( 119 dictionary[key].Update(
119 self_duration, total_duration, depth, parent) 120 self_duration, total_duration, depth, parent)
120 else: 121 else:
121 dictionary[key] = SliceData( 122 dictionary[key] = SliceData(
122 key, self_duration, total_duration, depth, parent) 123 key, self_duration, total_duration, depth, parent)
123 124
124 # Process sub slices recursively 125 # Process sub slices recursively
125 for sub_slice in task_slice.sub_slices: 126 for sub_slice in task_slice.sub_slices:
126 ProcessTasksForSlice(dictionary, sub_slice, depth + 1, parent) 127 ProcessTasksForSlice(dictionary, sub_slice, depth + 1, parent)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698