gh-69990: Make Profile.print_stats support sorting by multiple values#104590
gh-69990: Make Profile.print_stats support sorting by multiple values#104590serhiy-storchaka merged 24 commits intopython:mainfrom
Conversation
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Please update the modules documentation.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Doc/library/profile.rst
Outdated
| to enable multi-level sorting. | ||
|
|
||
| .. versionadded:: 3.13 | ||
| :meth:`~Profile.print_stats` can now accept multiple sort arguments. |
There was a problem hiding this comment.
"can accept multiple sort arguments" looks confusing. Does print_stats('calls', 'time') or print_stats(sort='calls', sort='time') work?
There was a problem hiding this comment.
Example:
import cProfile
from pstats import SortKey
with cProfile.Profile() as pr:
pr.print_stats(sort=("time", "calls")) # or pr.print_stats(sort=(SortKey.TIME, SortKey.CALLS))I believe that adding a small example to the documentation would make it easier to understand the feature. What do you think?
Co-authored-by: Ege Akman <egeakmanegeakman@hotmail.com>
Co-authored-by: Ege Akman <egeakmanegeakman@hotmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ege Akman <egeakmanegeakman@hotmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
The failure is unrelated, being fixed in #115557 |
…values (pythonGH-104590) Co-authored-by: Chiu-Hsiang Hsu
…values (pythonGH-104590) Co-authored-by: Chiu-Hsiang Hsu
…values (pythonGH-104590) Co-authored-by: Chiu-Hsiang Hsu
Uh oh!
There was an error while loading. Please reload this page.