Parametrize # of longest tests in print_test_stats (#45941)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45941
This adds CLI options to the `test/print_test_stats.py` script for specifying how many of the longest tests should be printed. It also makes the following incidental changes:
- The script now has a `--help` option to describe its usage.
- The number of longest tests being shown is now displayed as a number, rather than in words.
- The median time is now displayed with the label `median_time` instead of `mean_time`, is calculated using `statistics.median` instead of raw indexing and bit shifting, and is displayed even when there are only two tests in a class.
Test Plan: Imported from OSS
Reviewed By: walterddr, seemethere
Differential Revision: D24154491
Pulled By: samestep
fbshipit-source-id: 9fa402bf0fa56badd505f87f289ac9cca1862d6b