Commit 62fe25b6 authored by Xiaowu Zhang's avatar Xiaowu Zhang

__init__.py: show apachedex for renderjs based web site

parent 943a005d
......@@ -52,6 +52,13 @@ import shlex
import sys
import time
import traceback
try:
from urllib.parse import urlparse
from urllib.parse import parse_qs
except ImportError:
from urlparse import urlparse
from urlparse import parse_qs
try:
import pytz
except ImportError:
......@@ -400,7 +407,10 @@ class GenericSiteStats(object):
else:
url = url_match.group('url')
# XXX: can eat memory if there are many different urls
self.url_apdex[url.split('?', 1)[0]].accumulate(match)
if url.split('?', 1)[0].endswith('ERP5Document_getHateoas'):
self.url_apdex[url.split('?', 1)[1]].accumulate(match)
else:
self.url_apdex[url.split('?', 1)[0]].accumulate(match)
status = match.group('status')
self.status[status][value_date] += 1
if self.error_detail and statusIsError(status):
......@@ -623,6 +633,14 @@ class ERP5SiteStats(GenericSiteStats):
elif split and split[0] == 'ERP5Site_viewSearchResult':
super(ERP5SiteStats, self).accumulate(match, url_match, value_date)
self.site_search[value_date].accumulate(match)
elif split and split[-1].endswith('ERP5Document_getHateoas'):
super(ERP5SiteStats, self).accumulate(match, url_match, value_date)
#mode=traverse&relative_url=web_page_module%2F14351&view=view
split = self.suffix(url_match.group('url')).split('?', 1)[1]
parsed_url = urlparse("https://dummy?%s" % split)
related_url = parse_qs(parsed_url.query)['relative_url'][0]
module = related_url.split('/')[0]
self.module[module][not related_url.endswith('module')][value_date].accumulate(match)
elif split and self.expand_other:
self.no_module[split[0]][value_date].accumulate(match)
else:
......
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