mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 03:24:54 +00:00
include the ability to profile the web server, code lifted straight from the daemon
This commit is contained in:
parent
479d84857f
commit
52b5e9d4e3
1 changed files with 8 additions and 0 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue