forked from archive/andrewferrier_email2pdf
Add initial performance profiling support.
This commit is contained in:
parent
6604f6938d
commit
88923c7bf7
3 changed files with 12 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -55,3 +55,5 @@ docs/_build/
|
|||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
.email2pdf.profile
|
||||
|
|
6
Makefile
6
Makefile
|
@ -59,4 +59,10 @@ coverage:
|
|||
nosetests tests/Direct/*.py --with-coverage --cover-package=email2pdf,tests --cover-erase --cover-html --cover-branches
|
||||
open cover/index.html
|
||||
|
||||
.email2pdf.profile: email2pdf
|
||||
python3 -m cProfile -o .email2pdf.profile `which nosetests` .
|
||||
|
||||
profile: .email2pdf.profile
|
||||
python3 performance/printstats.py | less
|
||||
|
||||
alltests: unittest analysis coverage
|
||||
|
|
4
performance/printstats.py
Normal file
4
performance/printstats.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
import pstats
|
||||
|
||||
p = pstats.Stats('.email2pdf.profile')
|
||||
p.strip_dirs().sort_stats('time').print_callers(30)
|
Loading…
Add table
Reference in a new issue