OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 json | 5 import json |
| 6 |
6 from telemetry.page import page_test | 7 from telemetry.page import page_test |
7 from telemetry.value import histogram | 8 from telemetry.value import histogram |
8 from telemetry.value import histogram_util | 9 from telemetry.value import histogram_util |
9 from telemetry.value import scalar | 10 from telemetry.value import scalar |
10 from telemetry.value import skip | 11 from telemetry.value import skip |
11 | 12 |
12 _NAME = 'V8.DetachedContextAgeInGC' | 13 _NAME = 'V8.DetachedContextAgeInGC' |
13 _UNITS = 'garbage_collections' | 14 _UNITS = 'garbage_collections' |
14 _DISPLAY_NAME = 'V8_DetachedContextAgeInGC' | 15 _DISPLAY_NAME = 'V8_DetachedContextAgeInGC' |
15 _TYPE = histogram_util.RENDERER_HISTOGRAM | 16 _TYPE = histogram_util.RENDERER_HISTOGRAM |
(...skipping 29 matching lines...) Expand all Loading... |
45 for _ in xrange(MAX_AGE): | 46 for _ in xrange(MAX_AGE): |
46 tab.CollectGarbage() | 47 tab.CollectGarbage() |
47 value = _GetMaxDetachedContextAge(tab, self._data_start) | 48 value = _GetMaxDetachedContextAge(tab, self._data_start) |
48 if value is None: | 49 if value is None: |
49 results.AddValue(skip.SkipValue( | 50 results.AddValue(skip.SkipValue( |
50 results.current_page, 'No detached contexts')) | 51 results.current_page, 'No detached contexts')) |
51 else: | 52 else: |
52 results.AddValue(scalar.ScalarValue( | 53 results.AddValue(scalar.ScalarValue( |
53 results.current_page, _DISPLAY_NAME, _UNITS, value, | 54 results.current_page, _DISPLAY_NAME, _UNITS, value, |
54 description=_DESCRIPTION)) | 55 description=_DESCRIPTION)) |
OLD | NEW |