Part of bzrlib.lsprof View In Hierarchy
A Stats instance is created when the profiler finishes. Normal usage is to use save() to write out the data to a file, or pprint() to write human-readable information to the command line.
Method | __init__ | Undocumented |
Method | sort | Sort the data by the supplied critera. |
Method | pprint | Pretty-print the data as plain text for human consumption. |
Method | freeze | Replace all references to code objects with string |
Method | calltree | Output profiling data in calltree format (for KCacheGrind). |
Method | save | Save profiling data to a file. |
Parameters | crit | the data attribute used as the sort key. |
Parameters | top | only output the top n entries. The default value of None means output all data. |
file | the output file; if None, output will default to stdout. |
Parameters | filename | the name of the output file |
format | 'txt' for a text representation; 'callgrind' for calltree format; otherwise a pickled Python object. A format of None indicates that the format to use is to be found from the filename. If the name starts with callgrind.out, callgrind format is used otherwise the format is given by the filename extension. |