Download:
child 81:51c58566e6bd
parent 79:3adb8b3de974
80:436253f05ae4
Anton Shestakov <av6@dwimlabs.net>, Fri, 05 Aug 2016 12:20:39 +0800
bench: consider --marks when also --auto

1 файлов изменено, 12 вставок(+), 11 удалений(-) [+]
bench.py file | annotate | diff | comparison | revisions
--- a/bench.py Thu Aug 04 14:46:35 2016 +0800
+++ b/bench.py Fri Aug 05 12:20:39 2016 +0800
@@ -91,7 +91,7 @@
return output.split()
-def guessnew(maxrevs):
+def guessnew(maxrevs, marks):
""" Pick one continuous span of nodes that still need testing. """
cmd = [HG, 'log', '-R', TESTHGREPO, '-T', '{node}\n', '-r', 'sort(all(), rev)']
output = check_output(cmd)
@@ -105,7 +105,7 @@
'SELECT COUNT(*) FROM results'
' WHERE node = ?',
(node,)).fetchone()[0]
- if count < len(MARKS) * len(('without cache', 'with cache')):
+ if count < len(marks) * len(('without cache', 'with cache')):
todo.append(node)
picking = True
elif picking:
@@ -114,7 +114,7 @@
return todo
-def guessspikes(maxrevs):
+def guessspikes(maxrevs, marks):
cmd = [HG, 'log', '-R', TESTHGREPO, '-T', '{node}\n', '-r', 'sort(all(), -rev)']
output = check_output(cmd)
nodes = output.split()
@@ -131,7 +131,7 @@
'SELECT MIN(time), MAX(time) FROM results'
' WHERE mark = ? AND cache = ?',
(mark, True)).fetchone()
- for mark in MARKS
+ for mark in marks
}
results = {}
for node in nodes:
@@ -151,7 +151,7 @@
node1 = nodes[i - 1]
node2 = nodes[i]
node3 = nodes[i + 1]
- for mark in MARKS:
+ for mark in marks:
for cache in (False, True):
try:
eps = abs(results[node1][mark][cache] - results[node3][mark][cache])
@@ -269,18 +269,19 @@
def main(args):
+ if args.marks == 'all':
+ marks = MARKS
+ else:
+ names = args.marks.split(',')
+ marks = OrderedDict((k, v) for k, v in MARKS.items() if k in names)
lock()
try:
dbinit()
if args.auto:
if args.retry:
- args.revsets = guessspikes(args.auto)
+ args.revsets = guessspikes(args.auto, marks)
else:
- args.revsets = guessnew(args.auto)
- if args.marks == 'all':
- marks = MARKS
- else:
- marks = OrderedDict((k, v) for k, v in MARKS.items() if k in args.marks.split(','))
+ args.revsets = guessnew(args.auto, marks)
dbupdate(args.revsets, marks, args.mintime, args.mintries, args.retry)
finally:
unlock()