Commit cf2e7f89 authored by Alexandre's avatar Alexandre
Browse files

Better message output

parent f3b3350e
......@@ -499,8 +499,10 @@ def run_default(name, connection, opts):
connection.init_multi()
for i in range (0, opts.tests):
if opts.tests > 1 and (opts.verbose or opts.display_results):
print("\nTest %i" % i)
if not opts.pipelining and not opts.multistreams:
if opts.tests > 1 and (opts.verbose or opts.display_results):
print("\nTest %i" % i)
if opts.ifile is not None:
name, opts.rtype = get_next_domain(input)
......@@ -540,13 +542,12 @@ def run_default(name, connection, opts):
if opts.multistreams:
connection.perform_multi(opts.show_time, display_results=opts.display_results)
elif opts.pipelining:
print()
done = 0
try:
current = connection.pipelining_init_pending(opts.max_in_flight)
except homer.ConnectionDOTException as e:
ok = False
error(e)
error("%s, %i/%i requests never got a reply" % (e, opts.tests - connection.nbr_finished_queries, opts.tests))
else:
while done < opts.tests:
if time.time() > start + homer.MAX_DURATION: # if we send thousands of requests
......@@ -555,7 +556,7 @@ def run_default(name, connection, opts):
# on the number of queries
# or to define a relation such as
# f(tests) = MAX_DURATION
print("Elapsed time too long, %i requests never got a reply" % (opts.tests-done))
error("Elapsed time too long, %i/%i requests never got a reply" % (opts.tests-done, opts.tests))
ok = False
break
id = connection.read_result(connection, connection.pending, display_results=opts.display_results)
......@@ -571,13 +572,14 @@ def run_default(name, connection, opts):
connection.pipelining_fill_pending(current)
except homer.ConnectionDOTException as e:
ok = False
error(e)
error("%s, %i/%i requests never got a reply" % (e, opts.tests - connection.nbr_finished_queries, opts.tests))
break
current += 1
n_queries = connection.nbr_finished_queries
stop = time.time()
n_queries = connection.nbr_finished_queries
if n_queries > 1 and not opts.pipelining and not opts.multistreams:
extra = ", %.2f ms/request if we ignore the first one" % ((stop-start2)*1000/(n_queries-1))
else:
......
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