blob: f7e9542103bb06fab39e73aa80910f7938ed31ce [file] [log] [blame]
Dennis Kempin19e972b2013-06-20 13:21:38 -07001#! /usr/bin/env python
2# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6from optparse import OptionParser
7from mtstat import MTStat
8
9usage = """Multitouch Statistic Collector
10
11Download latest N feedback reports
12$ %prog -d N
13"""
14
15def main():
16 parser = OptionParser(usage=usage)
17 parser.add_option('-d',
18 dest='download', default=None,
19 help='download more log files')
20 parser.add_option('-o',
21 dest='offset', default=0,
22 help='offset for downloading log files')
23 parser.add_option('-n',
24 dest='number', default=None,
25 help='number of log files to gather stats on')
26 (options, args) = parser.parse_args()
27
28 stat = MTStat()
29 if options.download:
30 stat.Download(options.download, options.offset)
31 return
32
33 number = None if options.number is None else int(options.number)
34 results = stat.GatherStats(number)
35 for key, value in results.items():
36 print key, '=', value
37
38if __name__ == '__main__':
39 main()