changeset 170:92e708d6e3a1

profiling the push
author Scott Chacon <schacon@gmail.com>
date Tue, 02 Jun 2009 21:27:19 -0700
parents d67d00738298
children 88e413d853ee
files __init__.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/__init__.py	Tue Jun 02 19:33:48 2009 -0700
+++ b/__init__.py	Tue Jun 02 21:27:19 2009 -0700
@@ -48,7 +48,15 @@
 
 def gpush(ui, repo, remote_name='origin', branch=None):
     git = GitHandler(repo, ui)
-    git.push(remote_name)
+    import cProfile, pstats
+    prof = cProfile.Profile()
+    prof = prof.runctx("git.push(remote_name)", globals(), locals())
+    stats = pstats.Stats(prof)
+    stats.sort_stats("time")  # Or cumulative
+    stats.print_stats(80)  # 80 = how many to print
+    # The rest is optional.
+    # stats.print_callees()
+    # stats.print_callers()
 
 def gimport(ui, repo, remote_name=None):
     git = GitHandler(repo, ui)