Commit eb74803f authored by Deathcrow's avatar Deathcrow
Browse files

minor optimizations

parent 62f109f0
......@@ -92,10 +92,10 @@ def process_proc_tcpprobe(sender): #sampling
# write time + current tcpprobe line to file for this sender
unprocessed_senders.pop(key)['tcpprobe_file'].write(str(time_dif)+" "+" ".join(line_split[1:]))
break
else: # no break occured
if line == "": # this shouldn't happen. Try to continue anyway
print("CRITICAL ERROR!")
unprocessed_senders={}
else: # no break occured
if line == "": # this shouldn't happen. Try to continue anyway
print("CRITICAL ERROR!")
unprocessed_senders={}
tcpprobe_proc.close()
......@@ -200,29 +200,31 @@ if args.tcpdump == "1":
tcpdump = subprocess.Popen(["tcpdump", "-iany", "-w"+args.tmp_folder+"/tcpdump_"+str(mypid), "-s100"])
# if congesion_algo == all check proc and do all
#TODO? if congesion_algo == all check proc and do all
#setup done, run tests
start_time = time.perf_counter()
for key, i in enumerate(sender):
utility_command = [ args.utility, \
i['utility_command'] = [ args.utility, \
utility_args['connect'], i['dst'], \
utility_args['bind'], i['src'] , \
utility_args['time'], args.time, \
utility_args['port'], args.port, \
utility_args['ipv6'] ]
if args.utility == "netperf":
utility_command+= [ "--", "-k", "all", "-P", i['src_port'] ]
utility_command += [ utility_args['congestion'], i['congestion'] ]
i['utility_command'] += [ "--", "-k", "all", "-P", i['src_port'] ]
i['utility_command'] += [ utility_args['congestion'], i['congestion'] ]
if args.no_delay:
utility_command += [ utility_args['no_delay'] ]
i['utility_command'] += [ utility_args['no_delay'] ]
i['utility_file'] = open(args.tmp_folder+"/"+args.utility+"_"+i['congestion']+"_"+str(key), 'w+')
i['utility'] = subprocess.Popen(utility_command, stdout=i['utility_file'])
print(i['utility'].args)
print(i['src']+":"+i['src_port']+" "+i['dst']+":"+i['port'])
# print(i['src']+":"+i['src_port']+" "+i['dst']+":"+i['port'])
#setup done, run tests
start_time = time.perf_counter()
for key, i in enumerate(sender):
i['utility'] = subprocess.Popen(i['utility_command'], stdout=i['utility_file'])
print(i['utility'].args)
if args.utility != "netperf":
ss_file = tempfile.TemporaryFile(mode='r+')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment