|
|
@ -227,7 +227,6 @@ args = argp.parse_args() |
|
|
|
if args.verbose: |
|
|
|
if args.verbose: |
|
|
|
logger.setLevel(logging.DEBUG) |
|
|
|
logger.setLevel(logging.DEBUG) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CLIENT_HOSTS = [] |
|
|
|
CLIENT_HOSTS = [] |
|
|
|
if args.client_hosts: |
|
|
|
if args.client_hosts: |
|
|
|
CLIENT_HOSTS = args.client_hosts.split(',') |
|
|
|
CLIENT_HOSTS = args.client_hosts.split(',') |
|
|
@ -297,13 +296,15 @@ def get_client_stats(num_rpcs, timeout_sec): |
|
|
|
else: |
|
|
|
else: |
|
|
|
hosts = ['localhost'] |
|
|
|
hosts = ['localhost'] |
|
|
|
for host in hosts: |
|
|
|
for host in hosts: |
|
|
|
with grpc.insecure_channel('%s:%d' % (host, args.stats_port)) as channel: |
|
|
|
with grpc.insecure_channel('%s:%d' % |
|
|
|
|
|
|
|
(host, args.stats_port)) as channel: |
|
|
|
stub = test_pb2_grpc.LoadBalancerStatsServiceStub(channel) |
|
|
|
stub = test_pb2_grpc.LoadBalancerStatsServiceStub(channel) |
|
|
|
request = messages_pb2.LoadBalancerStatsRequest() |
|
|
|
request = messages_pb2.LoadBalancerStatsRequest() |
|
|
|
request.num_rpcs = num_rpcs |
|
|
|
request.num_rpcs = num_rpcs |
|
|
|
request.timeout_sec = timeout_sec |
|
|
|
request.timeout_sec = timeout_sec |
|
|
|
rpc_timeout = timeout_sec + _CONNECTION_TIMEOUT_SEC |
|
|
|
rpc_timeout = timeout_sec + _CONNECTION_TIMEOUT_SEC |
|
|
|
logger.debug('Invoking GetClientStats RPC to %s:%d:', host, args.stats_port) |
|
|
|
logger.debug('Invoking GetClientStats RPC to %s:%d:', host, |
|
|
|
|
|
|
|
args.stats_port) |
|
|
|
response = stub.GetClientStats(request, |
|
|
|
response = stub.GetClientStats(request, |
|
|
|
wait_for_ready=True, |
|
|
|
wait_for_ready=True, |
|
|
|
timeout=rpc_timeout) |
|
|
|
timeout=rpc_timeout) |
|
|
@ -1813,7 +1814,6 @@ try: |
|
|
|
# resources). |
|
|
|
# resources). |
|
|
|
fail_on_failed_rpc = '' |
|
|
|
fail_on_failed_rpc = '' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
if not CLIENT_HOSTS: |
|
|
|
if not CLIENT_HOSTS: |
|
|
|
client_cmd_formatted = args.client_cmd.format( |
|
|
|
client_cmd_formatted = args.client_cmd.format( |
|
|
@ -1884,7 +1884,8 @@ try: |
|
|
|
finally: |
|
|
|
finally: |
|
|
|
if client_process: |
|
|
|
if client_process: |
|
|
|
if client_process.returncode: |
|
|
|
if client_process.returncode: |
|
|
|
logger.info('Client exited with code %d' % client_process.returncode) |
|
|
|
logger.info('Client exited with code %d' % |
|
|
|
|
|
|
|
client_process.returncode) |
|
|
|
else: |
|
|
|
else: |
|
|
|
client_process.terminate() |
|
|
|
client_process.terminate() |
|
|
|
test_log_file.close() |
|
|
|
test_log_file.close() |
|
|
|