Mercurial > hg
annotate tests/mockblackbox.py @ 42423:0ae593e791fb
profiling: show actual time spent in hotpath display
To get, for instance:
...
\ 6.6% 4.08s lock.py: __exit__ line 1566: ...
| 6.5% 4.01s exchange.py: close line 1191: ...
| 6.5% 4.01s transaction.py: _active line 1443: ...
| 6.5% 4.01s transaction.py: close line 47: ...
| 6.2% 3.84s scmutil.py: wrapped line 529: ...
| 6.2% 3.81s localrepo.py: wrapper line 2114: ...
| 6.2% 3.81s localrepo.py: updatecaches line 177: ...
...
instead of:
...
\ 6.6% lock.py: __exit__ line 1566: ...
| 6.5% exchange.py: close line 1191: ...
| 6.5% transaction.py: _active line 1443: ...
| 6.5% transaction.py: close line 47: ...
| 6.2% scmutil.py: wrapped line 529: ...
| 6.2% localrepo.py: wrapper line 2114: ...
| 6.2% localrepo.py: updatecaches line 177: ...
...
I find that if it's not displayed, I frequently end up estimating the
numbers by hand.
Differential Revision: https://phab.mercurial-scm.org/D6477
author | Valentin Gatien-Baron <vgatien-baron@janestreet.com> |
---|---|
date | Wed, 05 Jun 2019 12:51:21 -0400 |
parents | a8a902d7176e |
children | 2372284d9457 |
rev | line source |
---|---|
28943
417380aa5bbe
py3: use absolute_import in mockblackbox.py
Robert Stanca <robert.stanca7@gmail.com>
parents:
28028
diff
changeset
|
1 from __future__ import absolute_import |
37120
a8a902d7176e
procutil: bulk-replace function calls to point to new module
Yuya Nishihara <yuya@tcha.org>
parents:
36105
diff
changeset
|
2 from mercurial.utils import ( |
a8a902d7176e
procutil: bulk-replace function calls to point to new module
Yuya Nishihara <yuya@tcha.org>
parents:
36105
diff
changeset
|
3 procutil, |
28943
417380aa5bbe
py3: use absolute_import in mockblackbox.py
Robert Stanca <robert.stanca7@gmail.com>
parents:
28028
diff
changeset
|
4 ) |
24705
0ead0a07ed9c
tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 |
32412
043948c84647
devel: update blackbox to use default-date
Boris Feld <boris.feld@octobus.net>
parents:
28943
diff
changeset
|
6 # XXX: we should probably offer a devel option to do this in blackbox directly |
24705
0ead0a07ed9c
tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 def getuser(): |
36105
f49c3ee5b02f
py3: use b'' in mockblackbox.py
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32412
diff
changeset
|
8 return b'bob' |
28028
ac49ecb2a897
tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents:
24705
diff
changeset
|
9 def getpid(): |
ac49ecb2a897
tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents:
24705
diff
changeset
|
10 return 5000 |
24705
0ead0a07ed9c
tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 |
0ead0a07ed9c
tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 # mock the date and user apis so the output is always the same |
0ead0a07ed9c
tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 def uisetup(ui): |
37120
a8a902d7176e
procutil: bulk-replace function calls to point to new module
Yuya Nishihara <yuya@tcha.org>
parents:
36105
diff
changeset
|
14 procutil.getuser = getuser |
a8a902d7176e
procutil: bulk-replace function calls to point to new module
Yuya Nishihara <yuya@tcha.org>
parents:
36105
diff
changeset
|
15 procutil.getpid = getpid |