Commit 2d28a144 authored by Alexandre's avatar Alexandre
Browse files

Fix average request time with multistreams

When using multistreams, requests are sent in parallel. curl keeps
track of different time values for each handle independently. This
means that we can retrieve the transfer duration for each handle
It is then possible to calculate the average time taken by each
transfer independently. Even so this might be an interesting data to
compute, this does not reflect the benefits of using parallelism.
Therefore the average time taken by a request is calculate as the
total time elapsed to perform all the requests divided by the number
of transfers.
parent 6cbe39ea
......@@ -1346,10 +1346,7 @@ for connectTo in ip_set:
extra = ""
if not monitoring and (not check or verbose):
time_tot = stop - start
if multistreams:
time_per_request = sum(handle.time - handle.pretime for handle in conn.all_handles) / tests * 1000
time_per_request = time_tot / tests * 1000
time_per_request = time_tot / tests * 1000
print("\nTotal elapsed time: %.2f seconds (%.2f ms/request%s)" % (time_tot, time_per_request, extra))
if multistreams and verbose:
for rcode, n in conn.finished['http'].items():
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