Commit 6fbf7926 authored by Florian Lercher's avatar Florian Lercher

Print durations

parent 8b817d4c
......@@ -260,6 +260,8 @@ def run_test(commands, output_directory, name, bandwidth, initial_rtt, buffer_si
host_counter = 0
setup_done_ts = time.time()
try:
for cmd in commands:
sleeptime = cmd['start'] - current_time
......@@ -296,10 +298,12 @@ def run_test(commands, output_directory, name, bandwidth, initial_rtt, buffer_si
else:
print_error(e)
finally:
em_done_ts = time.time()
net.stop()
cleanup()
print('-' * TEXT_WIDTH)
return setup_done_ts, em_done_ts
def verify_arguments(commands, initial_values):
......@@ -388,8 +392,10 @@ if __name__ == '__main__':
output_directory = os.path.join(args.directory, '{}_{}'.format(time.strftime('%m%d_%H%M%S'), args.name))
start_ts = time.time()
# setLogLevel('info')
run_test(bandwidth=initial_values['bw'],
setup_done_ts, em_done_ts = run_test(bandwidth=initial_values['bw'],
initial_rtt=initial_values['rtt'],
commands=commands,
buffer_size=initial_values['burst_buffer'],
......@@ -398,6 +404,8 @@ if __name__ == '__main__':
output_directory=output_directory,
poll_interval=initial_values['poll_interval'])
done_ts = time.time()
compression = args.compression
if compression != COMPRESSION_METHODS[0]:
......@@ -407,3 +415,12 @@ if __name__ == '__main__':
compress_output(output_directory, compression)
print('-' * TEXT_WIDTH)
print('Output written to: {}'.format(output_directory))
millis = lambda t1, t2: int(round((t2 - t1) * 1000))
print('duration_setup: {} ms'.format(millis(start_ts, setup_done_ts)))
print('duration_emulation: {} ms'.format(millis(setup_done_ts, em_done_ts)))
print('duration_teardown: {} ms'.format(millis(em_done_ts, done_ts)))
print('duration_total: {} ms'.format(millis(start_ts, done_ts)))
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