mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
Only profile feed load calls.
This commit is contained in:
parent
10d3d335d2
commit
c95366f828
1 changed files with 3 additions and 1 deletions
|
@ -41,7 +41,9 @@ class LastSeenMiddleware(object):
|
||||||
class DBProfilerMiddleware:
|
class DBProfilerMiddleware:
|
||||||
def process_request(self, request):
|
def process_request(self, request):
|
||||||
setattr(request, 'activated_segments', [])
|
setattr(request, 'activated_segments', [])
|
||||||
if random.random() < .01:
|
if ((request.path.startswith('/reader/feed') or
|
||||||
|
request.path.startswith('/reader/river')) and
|
||||||
|
random.random() < .01):
|
||||||
request.activated_segments.append('db_profiler')
|
request.activated_segments.append('db_profiler')
|
||||||
connection.use_debug_cursor = True
|
connection.use_debug_cursor = True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue