Add pstats-specific display options to a parser.
(parser)
| 516 | |
| 517 | |
| 518 | def _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 | |
| 549 | def _sort_to_mode(sort_choice): |
no test coverage detected
searching dependent graphs…