Module: deluge
Branch: 1.2-stable
Commit: 52b5e9d4e32ecd882d90acab857e70f85d7287bd

Author: Damien Churchill <[email protected]>
Date:   Fri Feb 26 14:25:17 2010 +0000

include the ability to profile the web server, code lifted straight from the 
daemon

---

 deluge/ui/web/web.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/deluge/ui/web/web.py b/deluge/ui/web/web.py
index c53593c..b87d1d4 100644
--- a/deluge/ui/web/web.py
+++ b/deluge/ui/web/web.py
@@ -59,6 +59,9 @@ class Web(_UI):
         group.add_option("-p", "--port", dest="port", type="int",
             help="Sets the port to be used for the webserver",
             action="store", default=None)
+        group.add_option("--profile", dest="profile",
+            help="Profile the web server code"
+            action="store_true", default=False)
         try:
             import OpenSSL
         except:
@@ -107,6 +110,11 @@ class Web(_UI):
         if self.options.ssl:
             self.server.https = self.options.ssl
 
+        if self.options.profile:
+            import hotshot
+            hsp = 
hotshot.Profile(deluge.configmanager.get_config_dir("deluge-web.profile"))
+            hsp.start()
+
         self.server.install_signal_handlers()
         self.server.start()
 

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to