MCPcopy Index your code
hub / github.com/python/cpython / _add_pstats_options

Function _add_pstats_options

Lib/profiling/sampling/cli.py:518–546  ·  view source on GitHub ↗

Add pstats-specific display options to a parser.

(parser)

Source from the content-addressed store, hash-verified

516
517
518def _add_pstats_options(parser):
519 """Add pstats-specific display options to a parser."""
520 pstats_group = parser.add_argument_group("pstats format options")
521 pstats_group.add_argument(
522 "--sort",
523 choices=[
524 "nsamples",
525 "tottime",
526 "cumtime",
527 "sample-pct",
528 "cumul-pct",
529 "nsamples-cumul",
530 "name",
531 ],
532 default=None,
533 help="Sort order for pstats output (default: nsamples)",
534 )
535 pstats_group.add_argument(
536 "-l",
537 "--limit",
538 type=int,
539 default=None,
540 help="Limit the number of rows in the output (default: 15)",
541 )
542 pstats_group.add_argument(
543 "--no-summary",
544 action="store_true",
545 help="Disable the summary section in the pstats output",
546 )
547
548
549def _sort_to_mode(sort_choice):

Callers 1

_mainFunction · 0.85

Calls 2

add_argument_groupMethod · 0.45
add_argumentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…