- do_diff()/do_rdiff(): added "--missingok" parameter
[opensuse:osc.git] / osc_hotshot.py
1 #!/usr/bin/env python
2
3 import hotshot, hotshot.stats
4 import tempfile
5 import os, sys
6
7 from osc import commandline
8
9
10 if __name__ == '__main__':
11
12     (fd, filename) = tempfile.mkstemp(prefix = 'osc_profiledata_', dir = '/dev/shm')
13     f = os.fdopen(fd)
14
15     try:
16
17         prof = hotshot.Profile(filename)
18
19         prof.runcall(commandline.main)
20         print 'run complete. analyzing.'
21         prof.close()
22
23         stats = hotshot.stats.load(filename)
24         stats.strip_dirs()
25         stats.sort_stats('time', 'calls')
26         stats.print_stats(20)
27
28         del stats
29
30     finally:
31         f.close()
32         os.unlink(filename)