| 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 import os | 5 import os |
| 6 | 6 |
| 7 from measurements import smoothness_controller | 7 from measurements import smoothness_controller |
| 8 from measurements import timeline_controller | 8 from measurements import timeline_controller |
| 9 from telemetry.core.platform import tracing_category_filter | 9 from telemetry.core.platform import tracing_category_filter |
| 10 from telemetry.core.platform import tracing_options | 10 from telemetry.core.platform import tracing_options |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 if not gc_type is None and not forced: | 58 if not gc_type is None and not forced: |
| 59 values['oilpan_%s_mark' % gc_type].append(mark_time) | 59 values['oilpan_%s_mark' % gc_type].append(mark_time) |
| 60 values['oilpan_%s_sweep' % gc_type].append(sweep_time) | 60 values['oilpan_%s_sweep' % gc_type].append(sweep_time) |
| 61 | 61 |
| 62 # Dump | 62 # Dump |
| 63 page = results.current_page | 63 page = results.current_page |
| 64 unit = 'ms' | 64 unit = 'ms' |
| 65 for name in _NAMES_TO_DUMP: | 65 for name in _NAMES_TO_DUMP: |
| 66 if values[name]: | 66 if values[name]: |
| 67 results.AddValue(list_of_scalar_values.ListOfScalarValues( | 67 results.AddValue(list_of_scalar_values.ListOfScalarValues( |
| 68 page, name, unit, values[name])) | 68 page, name, unit, values[name], higher_is_better=False)) |
| 69 results.AddValue(scalar.ScalarValue( | 69 results.AddValue(scalar.ScalarValue( |
| 70 page, name + '_max', unit, max(values[name]))) | 70 page, name + '_max', unit, max(values[name]), |
| 71 higher_is_better=False)) |
| 71 results.AddValue(scalar.ScalarValue( | 72 results.AddValue(scalar.ScalarValue( |
| 72 page, name + '_total', unit, sum(values[name]))) | 73 page, name + '_total', unit, sum(values[name]), higher_is_better=False)) |
| 73 | 74 |
| 74 for do_type in ['mark', 'sweep']: | 75 for do_type in ['mark', 'sweep']: |
| 75 work_time = 0 | 76 work_time = 0 |
| 76 for gc_type in ['precise', 'conservative']: | 77 for gc_type in ['precise', 'conservative']: |
| 77 work_time += sum(values['oilpan_%s_%s' % (gc_type, do_type)]) | 78 work_time += sum(values['oilpan_%s_%s' % (gc_type, do_type)]) |
| 78 key = 'oilpan_%s' % do_type | 79 key = 'oilpan_%s' % do_type |
| 79 results.AddValue(scalar.ScalarValue(page, key, unit, work_time)) | 80 results.AddValue(scalar.ScalarValue(page, key, unit, work_time)) |
| 80 | 81 |
| 81 gc_time = 0 | 82 gc_time = 0 |
| 82 for key in values: | 83 for key in values: |
| 83 gc_time += sum(values[key]) | 84 gc_time += sum(values[key]) |
| 84 results.AddValue(scalar.ScalarValue(page, 'oilpan_gc', unit, gc_time)) | 85 results.AddValue(scalar.ScalarValue(page, 'oilpan_gc', unit, gc_time, |
| 86 higher_is_better=False)) |
| 85 | 87 |
| 86 | 88 |
| 87 class _OilpanGCTimesBase(page_test.PageTest): | 89 class _OilpanGCTimesBase(page_test.PageTest): |
| 88 def __init__(self, action_name = ''): | 90 def __init__(self, action_name = ''): |
| 89 super(_OilpanGCTimesBase, self).__init__(action_name) | 91 super(_OilpanGCTimesBase, self).__init__(action_name) |
| 90 self._timeline_model = None | 92 self._timeline_model = None |
| 91 | 93 |
| 92 def WillNavigateToPage(self, page, tab): | 94 def WillNavigateToPage(self, page, tab): |
| 93 # FIXME: Remove webkit.console when blink.console lands in chromium and | 95 # FIXME: Remove webkit.console when blink.console lands in chromium and |
| 94 # the ref builds are updated. crbug.com/386847 | 96 # the ref builds are updated. crbug.com/386847 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 151 |
| 150 class OilpanGCTimesForInternals(_OilpanGCTimesBase): | 152 class OilpanGCTimesForInternals(_OilpanGCTimesBase): |
| 151 def __init__(self): | 153 def __init__(self): |
| 152 super(OilpanGCTimesForInternals, self).__init__() | 154 super(OilpanGCTimesForInternals, self).__init__() |
| 153 | 155 |
| 154 @classmethod | 156 @classmethod |
| 155 def CustomizeBrowserOptions(cls, options): | 157 def CustomizeBrowserOptions(cls, options): |
| 156 # 'expose-internals-for-testing' can be enabled on content shell. | 158 # 'expose-internals-for-testing' can be enabled on content shell. |
| 157 assert 'content-shell' in options.browser_type | 159 assert 'content-shell' in options.browser_type |
| 158 options.AppendExtraBrowserArgs('--expose-internals-for-testing') | 160 options.AppendExtraBrowserArgs('--expose-internals-for-testing') |
| OLD | NEW |