Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: build/android/surface_stats.py

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/rezip/RezipApk.java ('k') | build/android/symbolize.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.device import adb_wrapper
17 from pylib.device import device_errors
16 from pylib.device import device_utils 18 from pylib.device import device_utils
17 from pylib.perf import surface_stats_collector 19 from pylib.perf import surface_stats_collector
18 from pylib.utils import run_tests_helper 20 from pylib.utils import run_tests_helper
19 21
20 22
21 _FIELD_FORMAT = { 23 _FIELD_FORMAT = {
22 'jank_count (janks)': '%d', 24 'jank_count (janks)': '%d',
23 'max_frame_delay (vsyncs)': '%d', 25 'max_frame_delay (vsyncs)': '%d',
24 'avg_surface_fps (fps)': '%.2f', 26 'avg_surface_fps (fps)': '%.2f',
25 'frame_lengths (vsyncs)': '%.3f', 27 'frame_lengths (vsyncs)': '%.3f',
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 parser.add_option('-d', 93 parser.add_option('-d',
92 '--delay', 94 '--delay',
93 dest='delay', 95 dest='delay',
94 default=1, 96 default=1,
95 type='float', 97 type='float',
96 help='Time in seconds to sleep between updates.') 98 help='Time in seconds to sleep between updates.')
97 99
98 options, _ = parser.parse_args(argv) 100 options, _ = parser.parse_args(argv)
99 run_tests_helper.SetLogLevel(options.verbose_count) 101 run_tests_helper.SetLogLevel(options.verbose_count)
100 102
101 device = device_utils.DeviceUtils(options.device) 103 if options.device:
104 device = device_utils.DeviceUtils(options.device)
105 else:
106 devices = adb_wrapper.AdbWrapper.GetDevices()
107 if not devices:
108 raise device_errors.NoDevicesError
109 device = device_utils.DeviceUtils(devices[0])
110
102 collector = surface_stats_collector.SurfaceStatsCollector(device) 111 collector = surface_stats_collector.SurfaceStatsCollector(device)
103 collector.DisableWarningAboutEmptyData() 112 collector.DisableWarningAboutEmptyData()
104 113
105 fields = options.fields.split(',') 114 fields = options.fields.split(',')
106 row_count = None 115 row_count = None
107 116
108 try: 117 try:
109 collector.Start() 118 collector.Start()
110 while True: 119 while True:
111 time.sleep(options.delay) 120 time.sleep(options.delay)
(...skipping 12 matching lines...) Expand all
124 _PrintResults(results) 133 _PrintResults(results)
125 row_count += 1 134 row_count += 1
126 except KeyboardInterrupt: 135 except KeyboardInterrupt:
127 sys.exit(0) 136 sys.exit(0)
128 finally: 137 finally:
129 collector.Stop() 138 collector.Stop()
130 139
131 140
132 if __name__ == '__main__': 141 if __name__ == '__main__':
133 main(sys.argv) 142 main(sys.argv)
OLDNEW
« no previous file with comments | « build/android/rezip/RezipApk.java ('k') | build/android/symbolize.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698