def main(): global hostfile global server global clients global dump global lockstat global client_only global priority global master options = getopt.getopt(sys.argv[1:], 'h:sldcp')[0] for opt, arg in options: if opt in ('-h'): hostfile = arg elif opt in ('-s'): stop_all() return elif opt in ('-l'): lockstat = True elif opt in ('-d'): dump = True elif opt in ('-c'): client_only = True elif opt in ('-p'): priority = True tc.init("~/results.d/pingpong/" + str(threads) + "+" + str(len(clients)) + "x" + str(client_threads) + "x" + str(conn_per_thread)) tc.log_print("Configuration:\n" + \ "Hostfile: " + ("None" if hostfile == None else hostfile) + "\n" \ "Lockstat: " + str(lockstat) + "\n" \ "KQ dump: " + str(dump) + "\n" \ "Client only: " + str(client_only) + "\n" + \ "Conn delay: " + str(conn_delay) + "\n" "Priority: " + str(priority) + "\n") if hostfile != None: hosts = tc.parse_hostfile(hostfile) server = tc.process_hostnames(server, hosts) clients = tc.process_hostnames(clients, hosts) master = tc.process_hostnames(master, hosts) stop_all() for i in range(0, len(sched), 2): esched = sched[i + 1] ename = sched[i] step_mul = 100 last_load = 0 cur_load = init_step tc.begin(ename) tc.log_print("============ Sched: " + str(ename) + " Flag: " + format(esched, '#04x') + " Load: MAX" + " ============") output, sout, serr = run_exp(esched, 600000, lockstat) keep_results(output, sout, serr) stop_all() while True: tc.log_print("============ Sched: " + str(ename) + " Flag: " + format(esched, '#04x') + " Load: " + str(cur_load) + " ============") output, sout, serr = run_exp(esched, cur_load, lockstat) qps = keep_results(output, sout, serr) pct = int((qps - last_load) / init_step * 100) tc.log_print("last_load: " + str(last_load) + " this_load: " + str(qps) + " inc_pct: " + str(pct) + "%") if pct <= term_pct: tc.log_print("inc_pct less than TERM_PCT " + str(term_pct) + "%. Done.") break if pct <= inc_pct: step_mul += step_inc_pct tc.log_print("inc_pct less than INC_PCT " + str(inc_pct) + "%. Increasing step multiplier to " + str(step_mul) + "%") last_load = qps cur_load += int(init_step * step_mul / 100) tc.log_print("") tc.end() stop_all()
def main(): global hostfile global server global master global clients global dump global lockstat global client_only options = getopt.getopt(sys.argv[1:], 'h:sldcp')[0] for opt, arg in options: if opt in ('-h'): hostfile = arg elif opt in ('-s'): stop_all() return elif opt in ('-l'): lockstat=True elif opt in ('-d'): dump=True elif opt in ('-c'): client_only=True tc.init("~/results.d/rss/" + str(threads) + "+" + str(len(clients)) + "x" + str(client_threads) + "x" + str(conn_per_thread)) tc.log_print("Configuration:\n" + \ "Hostfile: " + ("None" if hostfile == None else hostfile) + "\n" \ "Lockstat: " + str(lockstat) + "\n" \ "KQ dump: " + str(dump) + "\n" \ "Client only: " + str(client_only) + "\n") if hostfile != None: hosts = tc.parse_hostfile(hostfile) server = tc.process_hostnames(server, hosts) clients = tc.process_hostnames(clients, hosts) master = tc.process_hostnames(master, hosts) stop_all() for i in range(0, len(sched), 2): esched = sched[i+1] ename = sched[i] tc.begin(ename) stop_all() for j in range(0, len(pmc)): epmc = pmc[j] tc.log_print("============ Sched: " + str(ename) + " Flag: " + format(esched, '#04x') + " PMC: " + epmc + " Load: " + str(qps) + " ============") output, sout, serr = run_exp(esched, qps, lockstat, epmc) keep_results(output, sout, serr, epmc) tc.log_print("") tc.end() stop_all()
def main(): global hostfile global server global clients global dump global lockstat global client_only global server_delay options = getopt.getopt(sys.argv[1:], 'h:sldcDp')[0] for opt, arg in options: if opt in ('-h'): hostfile = arg elif opt in ('-s'): stop_all() return elif opt in ('-l'): lockstat=True elif opt in ('-d'): dump=True elif opt in ('-c'): client_only=True elif opt in ('-D'): server_delay=True tc.init("scale_" + str(len(clients)) + "x" + str(client_threads) + "x" + str(conn_per_thread)) tc.log_print("Configuration:\n" + \ "Hostfile: " + ("None" if hostfile == None else hostfile) + "\n" \ "Lockstat: " + str(lockstat) + "\n" \ "KQ dump: " + str(dump) + "\n" \ "Client only: " + str(client_only) + "\n" + \ "Server delay: " + str(server_delay) + "\n" + \ "Conn delay: " + str(conn_delay) + "\n") if hostfile != None: hosts = tc.parse_hostfile(hostfile) server = tc.process_hostnames(server, hosts) clients = tc.process_hostnames(clients, hosts) master = tc.process_hostnames(master, hosts) stop_all() for i in range(0, len(sched), 2): esched = sched[i+1] ename = sched[i] # output, sout, serr = run_exp(esched, 12, lockstat) # keep_results(99, output, sout, serr) # stop_all() tc.begin(ename) for j in range(0, len(threads)): ethread = threads[j] tc.log_print("============ Sched: " + str(ename) + " Thread: " + str(ethread) + " ============") output, sout, serr = run_exp(esched, ethread, lockstat) keep_results(ethread, output, sout, serr) tc.log_print("") tc.end() stop_all()