def site_stop(trailers): print 'HTTP:', assetlist = json.loads(resp['text'])['list'] for asset in assetlist: http_assetget(http1, http2, asset, httpclient) print stop()
def site_stop(trailers): assetlist = json.loads(resp['text'])['list'] print 'SPDY:', for asset in assetlist: spdy_assetget(spdy1, spdy2, asset, spdyclient) print stop()
def main(): args = get_args() mainhost_http = conf.mainhost + ':' + str(conf.http_port) mainhost_spdy = conf.mainhost + ':' + str(conf.spdy_port) secondhost_http = conf.secondhost + ':' + str(conf.http_port) secondhost_spdy = conf.secondhost + ':' + str(conf.spdy_port) mainhost_collect = conf.mainhost + ':' + str(conf.capture_port) times = {} sites = hello(mainhost_http) random.shuffle(sites) for i,site in enumerate(sites): # Randomize ordering of HTTP and SPDY transactions print 'Working on site:', i, '[%s] '%(str(datetime.datetime.now()),) http_delta = {} spdy_delta = {} if random.random() > 0.5: http_delta['order'] = 0 spdy_delta['order'] = 1 http_delta['time'] = http_siteget(mainhost_http, secondhost_http, site) spdy_delta['time'] = spdy_siteget(mainhost_spdy, secondhost_spdy, site) else: http_delta['order'] = 1 spdy_delta['order'] = 0 spdy_delta['time'] = spdy_siteget(mainhost_spdy, secondhost_spdy, site) http_delta['time'] = http_siteget(mainhost_http, secondhost_http, site) times[site] = {'order': i, 'timestamp': str(datetime.datetime.now())} times[site]['http'] = http_delta times[site]['spdy'] = spdy_delta print 'Testing complete!' result = collect(mainhost_collect, json.dumps(times)) print result stop()
def main(): args = get_args() mainhost_http = conf.mainhost + ':' + str(conf.http_port) mainhost_spdy = conf.mainhost + ':' + str(conf.spdy_port) secondhost_http = conf.secondhost + ':' + str(conf.http_port) secondhost_spdy = conf.secondhost + ':' + str(conf.spdy_port) mainhost_collect = conf.mainhost + ':' + str(conf.capture_port) times = {} sites = hello(mainhost_http) random.shuffle(sites) for i, site in enumerate(sites): # Randomize ordering of HTTP and SPDY transactions print 'Working on site:', i, '[%s] ' % (str(datetime.datetime.now()), ) http_delta = {} spdy_delta = {} if random.random() > 0.5: http_delta['order'] = 0 spdy_delta['order'] = 1 http_delta['time'] = http_siteget(mainhost_http, secondhost_http, site) spdy_delta['time'] = spdy_siteget(mainhost_spdy, secondhost_spdy, site) else: http_delta['order'] = 1 spdy_delta['order'] = 0 spdy_delta['time'] = spdy_siteget(mainhost_spdy, secondhost_spdy, site) http_delta['time'] = http_siteget(mainhost_http, secondhost_http, site) times[site] = {'order': i, 'timestamp': str(datetime.datetime.now())} times[site]['http'] = http_delta times[site]['spdy'] = spdy_delta print 'Testing complete!' result = collect(mainhost_collect, json.dumps(times)) print result stop()
def collect_stop(trailers): stop()
def hello_err(err): print 'Connection could not be completed...' stop() exit()
def hello_stop(trailers): resp['sitelist'] = json.loads(resp['text']) stop()
def response_done(trailers): stop()
def echo(chunk): if chunk.decode().strip().lower() in ['quit', 'stop']: stop() else: conn.write(("-> %s" % chunk).encode())
def error(err_msg): if err_msg: err("*** ERROR: %s (%s)\n" % (err_msg.desc, err_msg.detail) ) stop()
def echo(chunk): if chunk.strip().lower() in ["quit", "stop"]: stop() else: conn.write("-> %s" % chunk)
def error(err_msg): if err_msg: err("\033[1;31m*** ERROR:\033[0;39m %s (%s)\n" % (err_msg.desc, err_msg.detail)) if not err_msg.client_recoverable: stop()