Beispiel #1
0
 def fetch(self, request, callback, *args, **kwargs):
     method, url = _request_method_url(request)
     recording.pre_call_hook('HTTP.'+method, url, _request_info(request), None)
     def wrapper(request, callback, response, *args):
         recording.post_call_hook('HTTP.'+ method, url, _request_info(request), _response_info(response))
         callback(response)
     old_fetch(self,
       request,
       functools.partial(wrapper, request, callback),
       *args, **kwargs)
 def fetch(self, request, callback, *args, **kwargs):
     method, url = _request_info(request)
     recording.pre_call_hook('HTTP', method, url, None)
     def wrapper(request, callback, response, *args):
         recording.post_call_hook('HTTP', method, url, None)
         callback(response)
     super(AsyncHTTPClient, self).fetch(
       request,
       functools.partial(wrapper, request, callback),
       *args, **kwargs)
Beispiel #3
0
    def fetch(self, request, callback, *args, **kwargs):
        method, url = _request_info(request)
        recording.pre_call_hook('HTTP', method, url, None)

        def wrapper(request, callback, response, *args):
            recording.post_call_hook('HTTP', method, url, None)
            callback(response)

        super(AsyncHTTPClient,
              self).fetch(request, functools.partial(wrapper, request,
                                                     callback), *args,
                          **kwargs)
Beispiel #4
0
 def post_wrap(handler, chunk, cb):
     recording.pre_call_hook('POST', str(self.config.postprocessor), chunk, None)
     old_posts[self.config](handler, chunk, cb)
Beispiel #5
0
 def get_multi(self, keys, key_prefix=''):
     recording.pre_call_hook('MEMCACHE.get', key_prefix, keys, None)
     res = old_get_multi(self, keys, key_prefix)
     recording.post_call_hook('MEMCACHE.get', key_prefix, keys, res)
     return res
Beispiel #6
0
 def set_multi(self, mapping, time=0, key_prefix='', min_compress_len=0):
     recording.pre_call_hook('MEMCACHE.set', key_prefix, mapping, None)
     res = old_set_multi(self, mapping, time, key_prefix, min_compress_len)
     recording.post_call_hook('MEMCACHE.set', key_prefix, mapping, res)
     return res
Beispiel #7
0
 def _prepare_finish_with_xsl(self):
     recording.pre_call_hook('XSL.transform', self.transform_filename, self.doc, None)
     result = old_prepare_xsl(self)
     recording.post_call_hook('XSL.transform', self.transform_filename, self.doc, result)
     return result
 def fetch(self, request, *args, **kwargs):
     method, url = _request_info(request)
     recording.pre_call_hook('HTTP', method, url, None)
     response = super(HTTPClient, self).fetch(request, *args, **kwargs)
     recording.post_call_hook('HTTP', method, url, None)
     return response
Beispiel #9
0
 def fetch(self, request, *args, **kwargs):
     method, url = _request_info(request)
     recording.pre_call_hook('HTTP', method, url, None)
     response = super(HTTPClient, self).fetch(request, *args, **kwargs)
     recording.post_call_hook('HTTP', method, url, None)
     return response