summaryrefslogtreecommitdiff
path: root/rdiff-backup/src/profiled_rdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/src/profiled_rdb.py')
-rwxr-xr-xrdiff-backup/src/profiled_rdb.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/rdiff-backup/src/profiled_rdb.py b/rdiff-backup/src/profiled_rdb.py
new file mode 100755
index 0000000..91810c2
--- /dev/null
+++ b/rdiff-backup/src/profiled_rdb.py
@@ -0,0 +1,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)
+
+