pstats_print2list package

Submodules

pstats_print2list.pstats_print2list module

pstats_print2list.pstats_print2list.get_field_list()[source]

Get field list of pstats report standard.

pstats_print2list.pstats_print2list.get_pstats_print2list(fnames, filter_fnames=None, exclude_fnames=None, sort=None, sort_reverse=None, limit=None)[source]

Print stats with a filter or exclude filenames, sort index and limit. :param list fnames: cProfile standard files to process. :param list filter_fnames: Relative paths to filter and show them. :param list exclude_fnames: Relative paths to avoid show them. :param str sort: Standard pstats key of value to sort the result.

‘calls’ (call count)

‘cumulative’ (cumulative time)

‘cumtime’ (cumulative time)

‘file’ (file name)

‘filename’ (file name)

‘module’ (file name)

‘ncalls’ (call count)

‘pcalls’ (primitive call count)

‘line’ (line number)

‘name’ (function name)

‘nfl’ (name/file/line)

‘stdname’ (standard name)

‘time’ (internal time)

‘tottime’ (internal time)

Parameters:
  • sort_reverse (bool) – Reverse sort order.
  • limit (int) – Limit max result.
Returns:

List of dicts with pstats print result after filters, sorted and limited.

pstats_print2list.pstats_print2list.is_exclude(fname, exclude_fnames)[source]
pstats_print2list.pstats_print2list.is_fname_match(fname, fmatch_list)[source]
pstats_print2list.pstats_print2list.print_pstats_list(pstats, pformat=None)[source]

Print list of pstats dict formatted :param list pstats: pstats dicts to print :param str format: String.format style to show fields with keys:

ncalls, tottime, tt_percall, cumtime, ct_percall, file, lineno, method Default: “{ncalls:10s} {tottime:10s} {tt_percall:10s} {cumtime:10s}

{ct_percall:10s} {file}:{lineno} ({method})”
Returns:Directly print of result formatted and return True

Module contents