diff options
author | Kali Kaneko <kali@leap.se> | 2015-08-28 15:41:49 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-08-28 15:41:49 -0400 |
commit | 19d96f97d752ef481eec5f44b88aee0a6bbb8dcb (patch) | |
tree | 29ff012d268389043b10fb806a4384c67d92c982 /scripts/profiling/storage/profile-format.py | |
parent | da1a936af43962f4531eda51fa5834391f6745a1 (diff) | |
parent | 20966f78951d734f100ed6a6a6feedd15dbe79e7 (diff) |
Merge tag '0.7.2' into debian/experimental
Tag leap.soledad version 0.7.2
Diffstat (limited to 'scripts/profiling/storage/profile-format.py')
-rw-r--r-- | scripts/profiling/storage/profile-format.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/profiling/storage/profile-format.py b/scripts/profiling/storage/profile-format.py new file mode 100644 index 00000000..262a52ab --- /dev/null +++ b/scripts/profiling/storage/profile-format.py @@ -0,0 +1,29 @@ +#!/usr/bin/python + +import argparse +import pstats + + +def parse_args(): + # parse command line + parser = argparse.ArgumentParser() + parser.add_argument( + '-f', dest='statsfiles', action='append', required=True, + help='a stats file') + args = parser.parse_args() + return args.statsfiles + + +def format_stats(statsfiles): + for f in statsfiles: + ps = pstats.Stats(f) + ps.strip_dirs() + ps.sort_stats('time') + ps.print_stats() + ps.sort_stats('cumulative') + ps.print_stats() + + +if __name__ == '__main__': + statsfiles = parse_args() + format_stats(statsfiles) |