launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #00944
[Merge] lp:~lifeless/launchpad/oops into lp:launchpad/devel
Robert Collins has proposed merging lp:~lifeless/launchpad/oops into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#627940 of the blocking calls made only database statements are recorded in OOPS
https://bugs.launchpad.net/bugs/627940
#630612 Complete b0rkage of oops timing info
https://bugs.launchpad.net/bugs/630612
#632022 oops reports show negative total time
https://bugs.launchpad.net/bugs/632022
Gather time spend in google searches into the request timeline.
--
https://code.launchpad.net/~lifeless/launchpad/oops/+merge/35044
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lifeless/launchpad/oops into lp:launchpad/devel.
=== modified file 'lib/canonical/launchpad/utilities/searchservice.py'
--- lib/canonical/launchpad/utilities/searchservice.py 2010-08-20 20:31:18 +0000
+++ lib/canonical/launchpad/utilities/searchservice.py 2010-09-09 21:57:54 +0000
@@ -20,6 +20,7 @@
import urllib
from urlparse import urlunparse
+from lazr.restful.utils import get_current_browser_request
from lazr.uri import URI
from zope.interface import implements
@@ -32,6 +33,7 @@
ISearchService,
)
from canonical.launchpad.webapp import urlparse
+from lp.services.timeline.requesttimeline import get_request_timeline
class PageMatch:
@@ -193,8 +195,13 @@
"""
search_url = self.create_search_url(terms, start=start)
from canonical.lazr.timeout import urlfetch
- gsp_xml = urlfetch(search_url)
-
+ request = get_current_browser_request()
+ timeline = get_request_timeline(request)
+ action = timeline.start("google-search-api", search_url)
+ try:
+ gsp_xml = urlfetch(search_url)
+ finally:
+ action.finish()
page_matches = self._parse_google_search_protocol(gsp_xml)
return page_matches
@@ -251,7 +258,6 @@
"""
return self._getElementsByAttributeValue(doc, path, name, value)[0]
-
def _parse_google_search_protocol(self, gsp_xml):
"""Return a `PageMatches` object.
Follow ups