Improve log readability & polish scenario parameters
diff --git a/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py b/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
index 18a6e3f..f23b07c 100644
--- a/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
+++ b/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
@@ -34,12 +34,24 @@
_NUM_CORES = multiprocessing.cpu_count()
_NUM_CORE_PYTHON_CAN_USE = 1
_WORKER_ENTRY_FILE = os.path.split(os.path.abspath(__file__))[0] + '/worker.py'
-_SubWorker = collections.namedtuple('_SubWorker',
- ['process', 'port', 'channel', 'stub'])
_LOGGER = logging.getLogger(__name__)
+class _SubWorker(
+ collections.namedtuple('_SubWorker',
+ ['process', 'port', 'channel', 'stub'])):
+
+ def _repr(self):
+ return f'<_SubWorker pid={self.process.pid} port={self.port}>'
+
+ def __repr__(self):
+ return self._repr()
+
+ def __str__(self):
+ return self._repr()
+
+
def _get_server_status(start_time: float, end_time: float,
port: int) -> control_pb2.ServerStatus:
end_time = time.time()
@@ -231,9 +243,8 @@
for worker in sub_workers:
await worker.stub.QuitWorker(control_pb2.Void())
await worker.channel.close()
- _LOGGER.info('Waiting for sub worker [%s] to quit...', worker)
+ _LOGGER.info('Waiting for [%s] to quit...', worker)
await worker.process.wait()
- _LOGGER.info('Sub worker [%s] quit', worker)
async def _run_single_client(self, config, request_iterator, context):
running_tasks = []
diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py
index b7791af..c8c7f88 100644
--- a/tools/run_tests/performance/scenario_config.py
+++ b/tools/run_tests/performance/scenario_config.py
@@ -829,27 +829,34 @@
return 1200
def scenarios(self):
- yield _ping_pong_scenario(
- 'python_asyncio_protobuf_async_unary_ping_pong_64_max',
- rpc_type='UNARY',
- client_type='ASYNC_CLIENT',
- server_type='ASYNC_SERVER',
- outstanding=64,
- channels=1,
- unconstrained_client='async',
- categories=[SMOKETEST, SCALABLE])
+ for outstanding in [32, 64, 128, 256]:
+ for channels in [1, 5]:
+ yield _ping_pong_scenario(
+ 'python_asyncio_protobuf_async_unary_ping_pong_%dx%d_max' %
+ (
+ outstanding,
+ channels,
+ ),
+ rpc_type='UNARY',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ outstanding=outstanding,
+ channels=channels,
+ unconstrained_client='async',
+ categories=[SMOKETEST, SCALABLE])
- yield _ping_pong_scenario(
- 'python_asyncio_protobuf_async_unary_ping_pong_128_1thread',
- rpc_type='UNARY',
- client_type='ASYNC_CLIENT',
- server_type='ASYNC_SERVER',
- outstanding=128,
- channels=1,
- async_client_threads=1,
- async_server_threads=1,
- unconstrained_client='async',
- categories=[SMOKETEST, SCALABLE])
+ yield _ping_pong_scenario(
+ 'python_asyncio_protobuf_async_unary_ping_pong_%d_1thread' %
+ outstanding,
+ rpc_type='UNARY',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ outstanding=outstanding,
+ channels=1,
+ async_client_threads=1,
+ async_server_threads=1,
+ unconstrained_client='async',
+ categories=[SMOKETEST, SCALABLE])
yield _ping_pong_scenario(
'python_asyncio_generic_async_streaming_ping_pong',