Commit 7efacb5f authored by Luke Macken's avatar Luke Macken

More documentation improvements

parent b31b203b
pyrasite - A command-line interface for injecting code into a running Python process
====================================================================================
pyrasite - Inject arbitrary code into a running Python process
==============================================================
::
......
pyrasite-gui - A graphical interface for Pyrasite
=================================================
The GUI has been moved into it's own repository:
The pyrasite-gui is a graphical interface for Pyrasite that lets you
easily monitor, analyze, introspect, and alter running Python programs.
https://github.com/lmacken/pyrasite-gui
:source: https://github.com/lmacken/pyrasite-gui
:download: http://pypi.python.org/pypi/pyrasite-gui
:requirements: http://readthedocs.org/docs/pyrasite/en/latest/Installing.html#gui
.. image:: http://lewk.org/img/pyrasite/pyrasite-info.png
......
pyrasite-memory-viewer - View the largest objects in your process
-----------------------------------------------------------------
Pyrasite provides a tool to view object memory usage statistics, and the
live value, of largest objects in your process. This requires `urwid
<http://pypi.python.org/pypi/urwid>`_ and `meliae
<https://launchpad.net/meliae>`_ to be installed.
::
$ pyrasite-memory-viewer <PID>
.. image:: http://lewk.org/img/pyrasite-memory-viewer.png
.. note:: We recommend using python-meliae from your OS distribution, if available. If it is not, you will need to first install Cython, and then meliae seperately. If pip/easy_install does not work, you may need to use the tarball from the upstream website.
This tool automatically injects the following payload:
.. literalinclude:: ../pyrasite/payloads/dump_memory.py
:language: python
:start-after: html
You can easily dump the object memory usage JSON data by hand, if you wish:
::
$ pyrasite <PID> pyrasite/payloads/dump_memory.py
Payloads
========
Example Payloads
================
Viewing the largest objects in your process
-------------------------------------------
These payloads can be found in the `pyrasite/payloads
<https://github.com/lmacken/pyrasite/tree/master/pyrasite/payloads>`_
directory.
Pyrasite provides a tool to view object memory usage statistics, and the
live value, of largest objects in your process. This requires `urwid
<http://pypi.python.org/pypi/urwid>`_ and `meliae
<https://launchpad.net/meliae>`_ to be installed.
::
$ pyrasite-memory-viewer <PID>
.. image:: http://lewk.org/img/pyrasite-memory-viewer.png
.. note:: We recommend using python-meliae from your OS distribution, if available. If it is not, you will need to first install Cython, and then meliae seperately. If pip/easy_install does not work, you may need to use the tarball from the upstream website.
This tool automatically injects the following payload:
Dumping thread stacks
---------------------
.. literalinclude:: ../pyrasite/payloads/dump_memory.py
.. literalinclude:: ../pyrasite/payloads/dump_stacks.py
:language: python
:start-after: html
You can easily dump the object memory usage JSON data by hand, if you wish:
::
$ pyrasite <PID> pyrasite/payloads/dump_memory.py
Viewing loaded modules
----------------------
.. literalinclude:: ../pyrasite/payloads/dump_modules.py
:language: python
Call Graph
----------
......@@ -40,49 +26,21 @@ graph using `pycallgraph <http://pycallgraph.slowchop.com>`_.
.. literalinclude:: ../pyrasite/payloads/start_callgraph.py
:language: python
:start-after: http
.. literalinclude:: ../pyrasite/payloads/stop_callgraph.py
:language: python
:start-after: http
::
$ pyrasite <PID> pyrasite/payloads/start_callgraph.py
$ pyrasite <PID> pyrasite/payloads/stop_callgraph.py
The callgraph is then generated using `graphviz <http://www.graphviz.org>`_ and
saved to `callgraph.png`. You can see an example callgraph `here <http://pycallgraph.slowchop.com/pycallgraph/wiki/RegExpExample>`_.
Viewing loaded modules
----------------------
.. literalinclude:: ../pyrasite/payloads/dump_modules.py
:language: python
::
$ pyrasite <PID> pyrasite/payloads/dump_modules.py
Dumping thread stacks
---------------------
.. literalinclude:: ../pyrasite/payloads/dump_stacks.py
:language: python
::
$ pyrasite <PID> pyrasite/payloads/dump_stacks.py
Forcing garbage collection
---------------------------
.. literalinclude:: ../pyrasite/payloads/force_garbage_collection.py
:language: python
::
$ pyrasite <PID> pyrasite/payloads/force_garbage_collection.py
Reverse Subprocess Shell
------------------------
......
......@@ -20,6 +20,7 @@ Contents
Installing
CLI
Shell
MemoryViewer
GUI
Payloads
API
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment