Mercurial > public > mercurial-scm > hg
comparison contrib/revsetbenchmarks.py @ 25646:57e7a060a06f
revsetbenchmark: do not abort on failure to run a revset
Instead of aborting the whole process, we just skip entry for revset that
failed to run.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 20 Jun 2015 16:22:10 -0700 |
parents | 5265932aad83 |
children | 328739ea70c3 |
comparison
equal
deleted
inserted
replaced
25645:977102cb12fc | 25646:57e7a060a06f |
---|---|
60 print >> sys.stderr, 'abort: cannot run revset benchmark: %s' % exc.cmd | 60 print >> sys.stderr, 'abort: cannot run revset benchmark: %s' % exc.cmd |
61 if exc.output is None: | 61 if exc.output is None: |
62 print >> sys.stderr, '(no ouput)' | 62 print >> sys.stderr, '(no ouput)' |
63 else: | 63 else: |
64 print >> sys.stderr, exc.output | 64 print >> sys.stderr, exc.output |
65 sys.exit(exc.returncode) | 65 return None |
66 | 66 |
67 outputre = re.compile(r'! wall (\d+.\d+) comb (\d+.\d+) user (\d+.\d+) ' | 67 outputre = re.compile(r'! wall (\d+.\d+) comb (\d+.\d+) user (\d+.\d+) ' |
68 'sys (\d+.\d+) \(best of (\d+)\)') | 68 'sys (\d+.\d+) \(best of (\d+)\)') |
69 | 69 |
70 def parseoutput(output): | 70 def parseoutput(output): |
158 | 158 |
159 _marker = object() | 159 _marker = object() |
160 def printresult(variants, idx, data, maxidx, verbose=False, reference=_marker): | 160 def printresult(variants, idx, data, maxidx, verbose=False, reference=_marker): |
161 """print a line of result to stdout""" | 161 """print a line of result to stdout""" |
162 mask = '%%0%ii) %%s' % idxwidth(maxidx) | 162 mask = '%%0%ii) %%s' % idxwidth(maxidx) |
163 | |
163 out = [] | 164 out = [] |
164 for var in variants: | 165 for var in variants: |
166 if data[var] is None: | |
167 out.append('error ') | |
168 out.append(' ' * 4) | |
169 continue | |
165 out.append(formattiming(data[var]['wall'])) | 170 out.append(formattiming(data[var]['wall'])) |
166 if reference is not _marker: | 171 if reference is not _marker: |
167 factor = None | 172 factor = None |
168 if reference is not None: | 173 if reference is not None: |
169 factor = getfactor(reference[var], data[var], 'wall') | 174 factor = getfactor(reference[var], data[var], 'wall') |