| 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.page import page_test | 5 from telemetry.page import legacy_page_test |
| 6 from telemetry.timeline.model import TimelineModel | 6 from telemetry.timeline.model import TimelineModel |
| 7 from telemetry.timeline import tracing_config | 7 from telemetry.timeline import tracing_config |
| 8 from telemetry.util import statistics | 8 from telemetry.util import statistics |
| 9 from telemetry.value import scalar | 9 from telemetry.value import scalar |
| 10 | 10 |
| 11 | 11 |
| 12 class TaskExecutionTime(page_test.PageTest): | 12 class TaskExecutionTime(legacy_page_test.LegacyPageTest): |
| 13 | 13 |
| 14 IDLE_SECTION_TRIGGER = 'SingleThreadIdleTaskRunner::RunTask' | 14 IDLE_SECTION_TRIGGER = 'SingleThreadIdleTaskRunner::RunTask' |
| 15 IDLE_SECTION = 'IDLE' | 15 IDLE_SECTION = 'IDLE' |
| 16 NORMAL_SECTION = 'NORMAL' | 16 NORMAL_SECTION = 'NORMAL' |
| 17 | 17 |
| 18 _TIME_OUT_IN_SECONDS = 60 | 18 _TIME_OUT_IN_SECONDS = 60 |
| 19 _NUMBER_OF_RESULTS_TO_DISPLAY = 10 | 19 _NUMBER_OF_RESULTS_TO_DISPLAY = 10 |
| 20 _BROWSER_THREADS = ['Chrome_ChildIOThread', | 20 _BROWSER_THREADS = ['Chrome_ChildIOThread', |
| 21 'Chrome_IOThread'] | 21 'Chrome_IOThread'] |
| 22 _RENDERER_THREADS = ['Chrome_ChildIOThread', | 22 _RENDERER_THREADS = ['Chrome_ChildIOThread', |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 def AddTask(self, name, duration): | 216 def AddTask(self, name, duration): |
| 217 if name in self.tasks: | 217 if name in self.tasks: |
| 218 # section_tasks already contains an entry for this (e.g. from an earlier | 218 # section_tasks already contains an entry for this (e.g. from an earlier |
| 219 # slice), add the new duration so we can calculate a median value later. | 219 # slice), add the new duration so we can calculate a median value later. |
| 220 self.tasks[name].Update(duration) | 220 self.tasks[name].Update(duration) |
| 221 else: | 221 else: |
| 222 # This is a new task so create a new entry for it. | 222 # This is a new task so create a new entry for it. |
| 223 self.tasks[name] = NameAndDurations(name, duration) | 223 self.tasks[name] = NameAndDurations(name, duration) |
| 224 # Accumulate total duration for all tasks in this section. | 224 # Accumulate total duration for all tasks in this section. |
| 225 self.total_duration += duration | 225 self.total_duration += duration |
| OLD | NEW |