| OLD | NEW |
| 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 | |
| 6 from telemetry.core.platform import tracing_options | |
| 7 from telemetry.page import page_test | 5 from telemetry.page import page_test |
| 8 from telemetry.timeline.model import TimelineModel | 6 from telemetry.timeline.model import TimelineModel |
| 7 from telemetry.timeline import tracing_category_filter |
| 8 from telemetry.timeline import tracing_options |
| 9 from telemetry.util import statistics | 9 from telemetry.util import statistics |
| 10 from telemetry.value import scalar | 10 from telemetry.value import scalar |
| 11 | 11 |
| 12 | 12 |
| 13 class TaskExecutionTime(page_test.PageTest): | 13 class TaskExecutionTime(page_test.PageTest): |
| 14 | 14 |
| 15 IDLE_SECTION_TRIGGER = 'SingleThreadIdleTaskRunner::RunTask' | 15 IDLE_SECTION_TRIGGER = 'SingleThreadIdleTaskRunner::RunTask' |
| 16 IDLE_SECTION = 'IDLE' | 16 IDLE_SECTION = 'IDLE' |
| 17 NORMAL_SECTION = 'NORMAL' | 17 NORMAL_SECTION = 'NORMAL' |
| 18 | 18 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 def AddTask(self, name, duration): | 220 def AddTask(self, name, duration): |
| 221 if name in self.tasks: | 221 if name in self.tasks: |
| 222 # section_tasks already contains an entry for this (e.g. from an earlier | 222 # section_tasks already contains an entry for this (e.g. from an earlier |
| 223 # slice), add the new duration so we can calculate a median value later. | 223 # slice), add the new duration so we can calculate a median value later. |
| 224 self.tasks[name].Update(duration) | 224 self.tasks[name].Update(duration) |
| 225 else: | 225 else: |
| 226 # This is a new task so create a new entry for it. | 226 # This is a new task so create a new entry for it. |
| 227 self.tasks[name] = NameAndDurations(name, duration) | 227 self.tasks[name] = NameAndDurations(name, duration) |
| 228 # Accumulate total duration for all tasks in this section. | 228 # Accumulate total duration for all tasks in this section. |
| 229 self.total_duration += duration | 229 self.total_duration += duration |
| OLD | NEW |