Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding get_profile_dict to pstats #82139

Closed
Olshansk mannequin opened this issue Aug 27, 2019 · 3 comments
Closed

Adding get_profile_dict to pstats #82139

Olshansk mannequin opened this issue Aug 27, 2019 · 3 comments
Labels
3.9 only security fixes extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@Olshansk
Copy link
Mannequin

Olshansk mannequin commented Aug 27, 2019

BPO 37958
Nosy @gpshead, @pablogsal, @miss-islington, @Olshansk
PRs
  • bpo-37958: Adding get_profile_dict to pstats #15495
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-01-15.22:59:29.803>
    created_at = <Date 2019-08-27.03:52:58.510>
    labels = ['extension-modules', 'type-feature', '3.9']
    title = 'Adding get_profile_dict to pstats'
    updated_at = <Date 2020-01-15.22:59:29.799>
    user = 'https://github.com/Olshansk'

    bugs.python.org fields:

    activity = <Date 2020-01-15.22:59:29.799>
    actor = 'gregory.p.smith'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-01-15.22:59:29.803>
    closer = 'gregory.p.smith'
    components = ['Extension Modules']
    creation = <Date 2019-08-27.03:52:58.510>
    creator = 'Daniel Olshansky'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37958
    keywords = []
    message_count = 3.0
    messages = ['350591', '360083', '360085']
    nosy_count = 4.0
    nosy_names = ['gregory.p.smith', 'pablogsal', 'miss-islington', 'Daniel Olshansky']
    pr_nums = ['15495']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue37958'
    versions = ['Python 3.9']

    @Olshansk
    Copy link
    Mannequin Author

    Olshansk mannequin commented Aug 27, 2019

    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).

    @Olshansk Olshansk mannequin added 3.7 (EOL) end of life extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Aug 27, 2019
    @gpshead gpshead added 3.9 only security fixes and removed 3.7 (EOL) end of life labels Sep 25, 2019
    @miss-islington
    Copy link
    Contributor

    New changeset 01602ae by Miss Islington (bot) (Daniel Olshansky) in branch 'master':
    bpo-37958: Adding get_profile_dict to pstats (GH-15495)
    01602ae

    @gpshead
    Copy link
    Member

    gpshead commented Jan 15, 2020

    Thanks Daniel!

    @gpshead gpshead closed this as completed Jan 15, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes extension-modules C modules in the Modules dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants