print_stats(*restrictions)
This method for the Stats
class prints out a report as described in the profile.run()
definition.
The order of the printing is based on the last sort_stats()
operation done on the object (subject to caveats in add()
and strip_dirs()
).
The arguments provided (if any) can be used to limit the list down to the significant entries. Initially, the list is taken to be the complete set of profiled functions. Each restriction is either an integer (to select a count of lines), or a decimal fraction between 0.0 and 1.0 inclusive (to select a percentage of lines), or a regular expression (to pattern match the standard name that is printed. If several restrictions are provided, then they are applied sequentially. For example:
print_stats(.1, 'foo:')
would first limit the printing to first 10% of list, and then only print functions that were part of filename .*foo:
. In contrast, the command:
print_stats('foo:', .1)
would limit the list to all functions having file names .*foo:
, and then proceed to only print the first 10% of them.
Please login to continue.