Commit 580a24eb authored by Vincent Pelletier's avatar Vincent Pelletier

Drop stale support for missing duration.

parent 72dab44a
...@@ -133,20 +133,18 @@ class GenericSiteStats(object): ...@@ -133,20 +133,18 @@ class GenericSiteStats(object):
def accumulate(self, match, url_match, date): def accumulate(self, match, url_match, date):
self.status[match.group('status')][date] += 1 self.status[match.group('status')][date] += 1
duration = match.group('duration')
self.apdex[date].accumulate(match) self.apdex[date].accumulate(match)
if duration is not None: duration = int(match.group('duration'))
duration = int(duration) if url_match is None:
if url_match is None: url = match.group('request')
url = match.group('request') else:
else: url = url_match.group('url')
url = url_match.group('url') if duration > self.slowest_list[0][0]:
if duration > self.slowest_list[0][0]: slowest_list = self.slowest_list
slowest_list = self.slowest_list slowest_list.append((duration, match.group('timestamp'), url,
slowest_list.append((duration, match.group('timestamp'), url, match.group('referer')))
match.group('referer'))) if len(slowest_list) > N_SLOWEST_THRESHOLD:
if len(slowest_list) > N_SLOWEST_THRESHOLD: self._housekeeping()
self._housekeeping()
def _housekeeping(self): def _housekeeping(self):
slowest_list = self.slowest_list slowest_list = self.slowest_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment