classification
Title: Adding get_profile_dict to pstats
Type: enhancement Stage:
Components: Extension Modules Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Daniel Olshansky, pablogsal
Priority: normal Keywords:

Created on 2019-08-27 03:52 by Daniel Olshansky, last changed 2019-09-25 21:58 by gregory.p.smith.

Pull Requests
URL Status Linked Edit
PR 15495 open Daniel Olshansky, 2019-08-27 03:52
Messages (1)
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).
History
Date User Action Args
2019-09-25 21:58:20gregory.p.smithsetversions: + Python 3.9, - Python 3.7
2019-08-27 03:52:58Daniel Olshanskycreate