| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Command line tool for continuously printing Android graphics surface | 7 """Command line tool for continuously printing Android graphics surface |
| 8 statistics on the console. | 8 statistics on the console. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import collections | 11 import collections |
| 12 import optparse | 12 import optparse |
| 13 import sys | 13 import sys |
| 14 import time | 14 import time |
| 15 | 15 |
| 16 from pylib import android_commands, surface_stats_collector | 16 from pylib import android_commands |
| 17 from pylib.perf import surface_stats_collector |
| 17 from pylib.utils import run_tests_helper | 18 from pylib.utils import run_tests_helper |
| 18 | 19 |
| 19 | 20 |
| 20 _FIELD_FORMAT = { | 21 _FIELD_FORMAT = { |
| 21 'jank_count (janks)': '%d', | 22 'jank_count (janks)': '%d', |
| 22 'max_frame_delay (vsyncs)': '%d', | 23 'max_frame_delay (vsyncs)': '%d', |
| 23 'avg_surface_fps (fps)': '%.2f', | 24 'avg_surface_fps (fps)': '%.2f', |
| 24 'frame_lengths (vsyncs)': '%.3f', | 25 'frame_lengths (vsyncs)': '%.3f', |
| 25 'refresh_period (seconds)': '%.6f', | 26 'refresh_period (seconds)': '%.6f', |
| 26 } | 27 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 _PrintResults(results) | 124 _PrintResults(results) |
| 124 row_count += 1 | 125 row_count += 1 |
| 125 except KeyboardInterrupt: | 126 except KeyboardInterrupt: |
| 126 sys.exit(0) | 127 sys.exit(0) |
| 127 finally: | 128 finally: |
| 128 collector.Stop() | 129 collector.Stop() |
| 129 | 130 |
| 130 | 131 |
| 131 if __name__ == '__main__': | 132 if __name__ == '__main__': |
| 132 main(sys.argv) | 133 main(sys.argv) |
| OLD | NEW |