[issue37958] Adding get_profile_dict to pstats

Daniel Olshansky report at bugs.python.org
Mon Aug 26 23:52:58 EDT 2019


New submission from Daniel Olshansky <olshansky.daniel at gmail.com>:

pstats is really useful or profiling and printing the output of the execution of some block of code, but I've found on multiple occasions that sometimes I'd like to access this output directly in an easily usable dictionary on which I can further analyze or manipulate.

My proposal is to add a function called get_profile_dict inside of pstats that'll automatically return this data. Please note that the PR I've put up is just a first version to get some feedback on, and it needs to be updated if the community chooses to move forward with it (e.g. we shouldn't be calling get_print_list inside of get_profile_dict in production code).

----------
components: Extension Modules
messages: 350591
nosy: Daniel Olshansky, pablogsal
priority: normal
pull_requests: 15216
severity: normal
status: open
title: Adding get_profile_dict to pstats
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37958>
_______________________________________


More information about the Python-bugs-list mailing list