Show More
@@ -28,6 +28,7 from .. import ( | |||||
28 | error, |
|
28 | error, | |
29 | hg, |
|
29 | hg, | |
30 | hook, |
|
30 | hook, | |
|
31 | profiling, | |||
31 | repoview, |
|
32 | repoview, | |
32 | templatefilters, |
|
33 | templatefilters, | |
33 | templater, |
|
34 | templater, | |
@@ -305,6 +306,7 class hgweb(object): | |||||
305 | should be using instances of this class as the WSGI application. |
|
306 | should be using instances of this class as the WSGI application. | |
306 | """ |
|
307 | """ | |
307 | with self._obtainrepo() as repo: |
|
308 | with self._obtainrepo() as repo: | |
|
309 | with profiling.maybeprofile(repo.ui): | |||
308 | for r in self._runwsgi(req, repo): |
|
310 | for r in self._runwsgi(req, repo): | |
309 | yield r |
|
311 | yield r | |
310 |
|
312 |
@@ -31,6 +31,7 from .. import ( | |||||
31 | encoding, |
|
31 | encoding, | |
32 | error, |
|
32 | error, | |
33 | hg, |
|
33 | hg, | |
|
34 | profiling, | |||
34 | scmutil, |
|
35 | scmutil, | |
35 | templater, |
|
36 | templater, | |
36 | ui as uimod, |
|
37 | ui as uimod, | |
@@ -217,7 +218,9 class hgwebdir(object): | |||||
217 | return False |
|
218 | return False | |
218 |
|
219 | |||
219 | def run_wsgi(self, req): |
|
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 | def _runwsgi(self, req): |
|
225 | def _runwsgi(self, req): | |
223 | try: |
|
226 | try: |
@@ -31,4 +31,18 test --profile | |||||
31 |
|
31 | |||
32 | #endif |
|
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 | $ cd .. |
|
48 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now