This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Adding get_profile_dict to pstats
Type: enhancement Stage: commit review
Components: Extension Modules Versions: Python 3.9
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Daniel Olshansky, gregory.p.smith, miss-islington, pablogsal
Priority: normal Keywords:

Created on 2019-08-27 03:52 by Daniel Olshansky, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15495 merged Daniel Olshansky, 2019-08-27 03:52
Messages (3)
msg350591 - (view) Author: Daniel Olshansky (Daniel Olshansky) * Date: 2019-08-27 03:52
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).
msg360083 - (view) Author: miss-islington (miss-islington) Date: 2020-01-15 22:52
New changeset 01602ae40321ecdb375ee6d44eaeac3255857879 by Miss Islington (bot) (Daniel Olshansky) in branch 'master':
bpo-37958: Adding get_profile_dict to pstats (GH-15495)
msg360085 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2020-01-15 22:59
Thanks Daniel!
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82139
2020-01-15 22:59:29gregory.p.smithsetstatus: open -> closed

nosy: + gregory.p.smith
messages: + msg360085

resolution: fixed
stage: commit review
2020-01-15 22:52:01miss-islingtonsetnosy: + miss-islington
messages: + msg360083
2019-09-25 21:58:20gregory.p.smithsetversions: + Python 3.9, - Python 3.7
2019-08-27 03:52:58Daniel Olshanskycreate