Commit 8b20f660 authored by Alexandre's avatar Alexandre
Browse files

Keep first transfer time in average with streams

parent b50e99a5
......@@ -1116,14 +1116,8 @@ for connectTo in ip_set:
else:
ok = run_check(conn) and ok # need to run run_check first
stop = time.time()
if tests > 1:
if multistreams:
time_tot_not_first = sum(handle.time - handle.pretime for handle in conn.all_handles)
time_tot_not_first -= (conn.first_handle.time - conn.first_handle.pretime)
else:
time_tot_not_first = stop - start2
time_req_not_first = time_tot_not_first * 1000 / (tests - 1)
extra = ", %.2f ms/request if we ignore the first one" % time_req_not_first
if tests > 1 and not multistreams:
extra = " , %.2f ms/request if we ignore the first one" % ((stop-start2)*1000/(tests-1))
else:
extra = ""
if not monitoring and (not check or verbose):
......@@ -1132,7 +1126,7 @@ for connectTo in ip_set:
time_per_request = sum(handle.time - handle.pretime for handle in conn.all_handles) / tests * 1000
else:
time_per_request = time_tot / tests * 1000
print("\nTotal elapsed time: %.2f seconds (%.2f ms/request %s)" % (time_tot, time_per_request, extra))
print("\nTotal elapsed time: %.2f seconds (%.2f ms/request%s)" % (time_tot, time_per_request, extra))
if ifile is not None:
input.close()
conn.end()
......
Supports Markdown
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