summaryrefslogtreecommitdiff
path: root/rdiff-backup/src/profiled_rdb.py
blob: 91810c2caf4b0d71547307537dce8c4d78ea2091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python

"""Run rdiff-backup with profiling on

Same as rdiff-backup but runs profiler, and prints profiling
statistics afterwards.

"""

__no_execute__ = 1
execfile("main.py")
import profile, pstats
profile.run("Globals.Main.Main(%s)" % repr(sys.argv[1:]), "profile-output")
p = pstats.Stats("profile-output")
p.sort_stats('time')
p.print_stats(20)
p.sort_stats('cumulative')
p.print_stats(20)