https://github.com/ymichael/cprofilev
:fire: An easier way to use cProfile
https://github.com/ymichael/cprofilev
Last synced: 11 months ago
JSON representation
:fire: An easier way to use cProfile
- Host: GitHub
- URL: https://github.com/ymichael/cprofilev
- Owner: ymichael
- License: mit
- Created: 2014-03-06T05:08:46.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-02-01T23:34:39.000Z (about 10 years ago)
- Last Synced: 2024-09-21T13:59:24.723Z (over 1 year ago)
- Language: Python
- Homepage: https://pypi.python.org/pypi/CProfileV
- Size: 46.9 KB
- Stars: 416
- Watchers: 9
- Forks: 30
- Open Issues: 10
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
- my-awesome-starred - cprofilev - An easier way to use cProfile (Python)
README
=========
cprofilev
=========
An easier way to use `cProfile `_.
______________________________
about
*****
cprofilev runs and profiles a given python program and outputs a simple html view of the statistics collected.
See: http://ymichael.com/2014/03/08/profiling-python-with-cprofile.html on how to make sense of the profiled statistics.
installation
*****
*on most UNIX-like systems, you'll probably need to run the following `install` command as root or by using sudo*
::
pip install cprofilev
quickstart
**********
1. Simply run your python program in with the **-m cprofilev** flag.
::
$ python -m cprofilev /path/to/python/program ...
2. Navigate to http://localhost:4000 to view profile statistics of your python program (even while its still running!)
Alternatively you can output view cprofile output using the **-f flag**:
::
# NOTE this is cProfile not cprofilev
$ python -m cProfile -o /path/to/save/output /path/to/python/program ...
$ cprofilev -f /path/to/save/output
usage
*****
::
usage: cprofilev.py [--version] [-a ADDRESS] [-p PORT] scriptfile [arg] ...
An easier way to use cProfile.
positional arguments:
scriptfile The python script file to run and profile.
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
-a ADDRESS, --address ADDRESS
The address to listen on. (defaults to 127.0.0.1).
-p PORT, --port PORT The port to listen on. (defaults to 4000).
-f FILE, --file FILE cProfile output to view.
If specified, the scriptfile provided will be ignored.
Dependencies
*****
`bottle `_: used for serving the html page.
Development
*****
To quickly contribute to cprofilev, you can use this example as a means to
profile things::
python -m cprofilev example_for_profiling.py