Download:
child 78:362eb6642d17
parent 76:ec0b2da5e468
77:c4a6cb0ec67c
Anton Shestakov <av6@dwimlabs.net>, Thu, 04 Aug 2016 14:34:15 +0800
bench: add --marks command line argument

1 файлов изменено, 9 вставок(+), 4 удалений(-) [+]
bench.py file | annotate | diff | comparison | revisions
--- a/bench.py Thu Aug 04 14:16:22 2016 +0800
+++ b/bench.py Thu Aug 04 14:34:15 2016 +0800
@@ -33,6 +33,7 @@
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')
@@ -190,17 +191,17 @@
conn.close()
-def dbupdate(revsets, retry=False):
+def dbupdate(revsets, marks, retry=False):
conn = sqlite3.connect(DBPATH)
makeclean()
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):
madelocal = False
- for mark in MARKS:
+ for mark in marks:
for cache in (False, True):
old = conn.execute(
'SELECT time FROM results'
@@ -274,7 +275,11 @@
args.revsets = guessspikes(args.auto)
else:
args.revsets = guessnew(args.auto)
- dbupdate(args.revsets, args.retry)
+ if args.marks == 'all':
+ marks = MARKS
+ else:
+ marks = OrderedDict((k, v) for k, v in MARKS.items() if k in args.marks.split(','))
+ dbupdate(args.revsets, marks, args.retry)
finally:
unlock()