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 import collections | 7 import collections |
8 import json | 8 import json |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 def main(argv): | 251 def main(argv): |
252 parser = optparse.OptionParser(usage='Usage: %prog [options]', | 252 parser = optparse.OptionParser(usage='Usage: %prog [options]', |
253 description=__doc__) | 253 description=__doc__) |
254 parser.add_option('-m', | 254 parser.add_option('-m', |
255 '--manual-graph', | 255 '--manual-graph', |
256 action='store_true', | 256 action='store_true', |
257 help='Manually collect data and generate a graph.') | 257 help='Manually collect data and generate a graph.') |
258 parser.add_option('-p', | 258 parser.add_option('-p', |
259 '--package', | 259 '--package', |
260 default=constants.CHROME_PACKAGE, | 260 default=constants.PACKAGE_INFO['chrome'].package, |
261 help='Package name to collect.') | 261 help='Package name to collect.') |
262 parser.add_option('-i', | 262 parser.add_option('-i', |
263 '--interval', | 263 '--interval', |
264 default=5, | 264 default=5, |
265 type='int', | 265 type='int', |
266 help='Interval in seconds for manual collections.') | 266 help='Interval in seconds for manual collections.') |
267 options, args = parser.parse_args(argv) | 267 options, args = parser.parse_args(argv) |
268 if options.manual_graph: | 268 if options.manual_graph: |
269 return _RunManualGraph(options.package, options.interval) | 269 return _RunManualGraph(options.package, options.interval) |
270 _DumpCSV(_CollectMemoryStats(sys.stdin, [value for (key, value) in _ENTRIES])) | 270 _DumpCSV(_CollectMemoryStats(sys.stdin, [value for (key, value) in _ENTRIES])) |
271 | 271 |
272 | 272 |
273 if __name__ == '__main__': | 273 if __name__ == '__main__': |
274 main(sys.argv) | 274 main(sys.argv) |
OLD | NEW |