Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mgedmin/profilehooks
Python decorators for profiling/tracing/timing a single function
https://github.com/mgedmin/profilehooks
Last synced: about 2 months ago
JSON representation
Python decorators for profiling/tracing/timing a single function
- Host: GitHub
- URL: https://github.com/mgedmin/profilehooks
- Owner: mgedmin
- License: mit
- Created: 2012-06-04T21:24:25.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-05-09T15:59:46.000Z (5 months ago)
- Last Synced: 2024-07-18T15:47:43.598Z (2 months ago)
- Language: Python
- Homepage: http://mg.pov.lt/profilehooks/
- Size: 179 KB
- Stars: 327
- Watchers: 12
- Forks: 30
- Open Issues: 12
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-python-decorator - profilehooks
README
profilehooks
============.. image:: https://github.com/mgedmin/profilehooks/workflows/build/badge.svg?branch=master
:target: https://github.com/mgedmin/profilehooks/actions.. image:: https://ci.appveyor.com/api/projects/status/github/mgedmin/profilehooks?branch=master&svg=true
:target: https://ci.appveyor.com/project/mgedmin/profilehooks.. image:: https://coveralls.io/repos/mgedmin/profilehooks/badge.svg?branch=master
:target: https://coveralls.io/r/mgedmin/profilehooksIt's a collection of decorators for profiling functions. E.g. to profile a
single function::from profilehooks import profile
@profile
def my_function(args, etc):
passThe results will be printed when the program exits (or you can use
``@profile(immediate=True)``).If you're interested in coarse timings and don't want to pay for the overhead
of profiling, use ::from profilehooks import timecall
@timecall # or @timecall(immediate=True)
def my_function(args, etc):
passFinally, you may be interested in seeing line coverage for a single function ::
from profilehooks import coverage
@coverage
def my_function(args, etc):
passAlso functions can be available in Python console or module if run it with -m arg ::
$ python -m profilehooks
>>> profile
$ python -m profilehooks yourmodule
Full documentation is available through ``pydoc profilehooks`` after
installation.The home page for this module is https://mg.pov.lt/profilehooks. It has
screensho, uh, that is, more examples.