Example #1
0
 def site_stop(trailers):
     print 'HTTP:',
     assetlist = json.loads(resp['text'])['list']
     for asset in assetlist:
         http_assetget(http1, http2, asset, httpclient)
     print
     stop()
Example #2
0
 def site_stop(trailers):
     assetlist = json.loads(resp['text'])['list']
     print 'SPDY:',
     for asset in assetlist:
         spdy_assetget(spdy1, spdy2, asset, spdyclient)
     print
     stop()
Example #3
0
 def site_stop(trailers):
     assetlist = json.loads(resp['text'])['list']
     print 'SPDY:',
     for asset in assetlist:
         spdy_assetget(spdy1, spdy2, asset, spdyclient)
     print
     stop()
Example #4
0
 def site_stop(trailers):
     print 'HTTP:',
     assetlist = json.loads(resp['text'])['list']
     for asset in assetlist:
         http_assetget(http1, http2, asset, httpclient)
     print
     stop()
Example #5
0
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()
Example #6
0
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()
Example #7
0
 def collect_stop(trailers):
     stop()
Example #8
0
 def hello_err(err):
     print 'Connection could not be completed...'
     stop()
     exit()
Example #9
0
 def hello_stop(trailers):
     resp['sitelist'] = json.loads(resp['text'])
     stop()
Example #10
0
File: client.py Project: nethi/thor
 def response_done(trailers):
     stop()
Example #11
0
 def echo(chunk):
     if chunk.decode().strip().lower() in ['quit', 'stop']:
         stop()
     else:
         conn.write(("-> %s" % chunk).encode())
Example #12
0
 def collect_stop(trailers):
     stop()
Example #13
0
 def hello_err(err):
     print 'Connection could not be completed...'
     stop()
     exit()
Example #14
0
 def hello_stop(trailers):
     resp['sitelist'] = json.loads(resp['text'])
     stop()
Example #15
0
File: client.py Project: nethi/thor
 def error(err_msg):
     if err_msg:
         err("*** ERROR: %s (%s)\n" %
             (err_msg.desc, err_msg.detail)
         )
     stop()
Example #16
0
File: tcp.py Project: mnot/thor
 def echo(chunk):
     if chunk.strip().lower() in ["quit", "stop"]:
         stop()
     else:
         conn.write("-> %s" % chunk)
Example #17
0
 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()