[rhmessaging-commits] rhmessaging commits: r1897 - mgmt/cumin/bin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Apr 9 15:40:49 EDT 2008


Author: justi9
Date: 2008-04-09 15:40:49 -0400 (Wed, 09 Apr 2008)
New Revision: 1897

Modified:
   mgmt/cumin/bin/cumin
Log:
Repair a reference to config.home.

Add a --profile option to profile the cumin server.



Modified: mgmt/cumin/bin/cumin
===================================================================
--- mgmt/cumin/bin/cumin	2008-04-09 18:25:42 UTC (rev 1896)
+++ mgmt/cumin/bin/cumin	2008-04-09 19:40:49 UTC (rev 1897)
@@ -25,8 +25,8 @@
     server = CuminServer(app, config.addr, config.port)
 
     if config.ssl:
-        cpath = os.path.join(home, "etc", "cumin.crt")
-        kpath = os.path.join(home, "etc", "cumin.key")
+        cpath = os.path.join(config.home, "etc", "cumin.crt")
+        kpath = os.path.join(config.home, "etc", "cumin.key")
 
         if os.path.isfile(cpath):
             server.set_ssl_cert_path(cpath)
@@ -70,7 +70,28 @@
     do_main(config)
 
 if __name__ == "__main__":
-    try:
-        main()
-    except KeyboardInterrupt:
-        pass
+    if "--profile" in sys.argv:
+        from profile import Profile
+        from pstats import Stats
+
+        prof = Profile()
+        
+        try:
+            prof.run("main()")
+        except KeyboardInterrupt:
+            pass
+
+        file = "/tmp/cumin-stats"
+        prof.dump_stats(file)
+
+        stats = Stats(file)
+
+        stats.sort_stats("cumulative").print_stats(15)
+        stats.sort_stats("time").print_stats(15)
+
+        stats.strip_dirs()
+    else:
+        try:
+            main()
+        except KeyboardInterrupt:
+            pass




More information about the rhmessaging-commits mailing list