--- a/bench.py Thu Aug 04 14:16:22 2016 +0800
+++ b/bench.py Thu Aug 04 14:34:15 2016 +0800
group = parser.add_mutually_exclusive_group()
group.add_argument('revsets', metavar='REVSET', default=('last(all(), 120)',), nargs='*', help='update these revisions')
group.add_argument('--auto', metavar='MAXREVS', type=int, help='guess revisions, up to MAXREVS')
+parser.add_argument('--marks', metavar='MARKS', default='all', help='test only these commands (comma-separated, default: all)')
parser.add_argument('--retry', action='store_true', help='try and reduce existing timings')
-def dbupdate(revsets, retry=False):
+def dbupdate(revsets, marks, retry=False):
conn = sqlite3.connect(DBPATH)
nodes = getnodes(revsets)
numwidth = len(str(len(nodes)))
- markwidth = max(len(mark) for mark in MARKS)
+ markwidth = max(len(mark) for mark in marks)
for i, node in enumerate(nodes, 1):
for cache in (False, True):
'SELECT time FROM results'
args.revsets = guessspikes(args.auto)
args.revsets = guessnew(args.auto)
- dbupdate(args.revsets, args.retry)
+ if args.marks == 'all':
+ marks = OrderedDict((k, v) for k, v in MARKS.items() if k in args.marks.split(','))
+ dbupdate(args.revsets, marks, args.retry)