Skip to main content

Add to pstats library of cProfile the feature of get the result in a list with filters, limit and sort.

Project description

pstats_print2list

https://img.shields.io/pypi/v/pstats_print2list.svg https://img.shields.io/travis/Vauxoo/pstats-print2list.svg https://coveralls.io/repos/github/Vauxoo/pstats-print2list/badge.svg?branch=master https://img.shields.io/pypi/dm/pstats_print2list.svg

Add to pstats library of cProfile the feature of get the result in a list with filters, limit and sort.

Features

  • Add the posiblity of get profiling report pstats result in a list.

  • Add the posibility of sort the result with a default pstats index.

  • Add the posilibity of add a limit to result.

  • Add the posibility of filter by paths or files.

  • Add the posibility of exclude paths or files.

Installation

  • Using pypi: pip install pstats_print2list

Usage

  • Small example:

import pstats_print2list
print "Method docstring", pstats_print2list.get_pstats_print2list.__doc__
pstats_list = pstats_print2list.get_pstats_print2list(['fname_stat1', 'fname_stat2'])
pstats_print2list.print_pstats_list(pstats_list)
  • Full example:

from pstats_print2list import get_pstats_print2list, print_pstats_list
fname_stats = 'my_profiling_out.stats'
pstats_list = get_pstats_print2list(
    fname_stats,
    filter_fnames=['myfile1.py', 'myfile2.py', 'root_path1'],
    exclude_fnames=['dontshow.py', 'path_dont_show'],
    sort='cumulative',
    limit=5,
)
print_pstats_list(pstats_list)

Credits

This package was created by Vauxoo

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Authors

Moisés López <moylop260@vauxoo.com>

History

0.1.0 (2016-02-22)

  • First release on PyPI.

1.1.2 (2016-02-26)

  • First stable version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pstats_print2list-1.1.3.tar.gz (16.2 kB view hashes)

Uploaded Source

Built Distribution

pstats_print2list-1.1.3-py2.py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page