mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +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:
|
||||
def process_request(self, request):
|
||||
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')
|
||||
connection.use_debug_cursor = True
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue