I have to test server based on Jetty. This server can work with its own protocol, HTTP, HTTPS and lastly it started to support SPDY. I have some stress tests which are based on httplib
/http.client
-- each thread start with similar URL (some data in query string are variable), adds execution time to global variable and every few seconds shows some statistics. Code looks like:
t_start = time.time()
connection.request("GET", path)
resp = connection.getresponse()
t_stop = time.time()
check_response(resp)
QRY_TIMES.append(t_stop - t_start)
Client working with native protocol shares httplib
API, so connection
may be native, HTTPConnection
or HTTPSConnection
.
Now I want to add SPDY test using spdylay
module. But its interface is opaque and I don't know how to change its opaqueness into something similar to httplib
interface. I have made test client based on example but while 2nd argument to spdylay.urlfetch()
is class name and not object I do not know how to use it with my tests. I have already add tests to on_close()
method of my class which extends spdylay.BaseSPDYStreamHandler
, but it is not compatibile with other tests. If it was instance I would use it outside of spdylay.urlfetch()
call.
How can I use spydlay
in a code that works based on httplib
interfaces?