##// END OF EJS Templates
hgweb: profile HTTP requests...
Gregory Szorc -
r29787:80df0426 default
parent child Browse files
Show More
@@ -28,6 +28,7 from .. import (
28 28 error,
29 29 hg,
30 30 hook,
31 profiling,
31 32 repoview,
32 33 templatefilters,
33 34 templater,
@@ -305,6 +306,7 class hgweb(object):
305 306 should be using instances of this class as the WSGI application.
306 307 """
307 308 with self._obtainrepo() as repo:
309 with profiling.maybeprofile(repo.ui):
308 310 for r in self._runwsgi(req, repo):
309 311 yield r
310 312
@@ -31,6 +31,7 from .. import (
31 31 encoding,
32 32 error,
33 33 hg,
34 profiling,
34 35 scmutil,
35 36 templater,
36 37 ui as uimod,
@@ -217,7 +218,9 class hgwebdir(object):
217 218 return False
218 219
219 220 def run_wsgi(self, req):
220 return self._runwsgi(req)
221 with profiling.maybeprofile(self.ui):
222 for r in self._runwsgi(req):
223 yield r
221 224
222 225 def _runwsgi(self, req):
223 226 try:
@@ -31,4 +31,18 test --profile
31 31
32 32 #endif
33 33
34 #if lsprof serve
35
36 Profiling of HTTP requests works
37
38 $ hg --profile --config profiling.format=text --config profiling.output=../profile.log serve -d -p $HGPORT --pid-file ../hg.pid -A ../access.log
39 $ cat ../hg.pid >> $DAEMON_PIDS
40 $ hg -q clone -U http://localhost:$HGPORT ../clone
41
42 A single profile is logged because file logging doesn't append
43 $ grep CallCount ../profile.log | wc -l
44 \s*1 (re)
45
46 #endif
47
34 48 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now