From dcfe59ad5d4eb7167b5ed7d5c6af5c3e73f98968 Mon Sep 17 00:00:00 2001 From: dingbo Date: Tue, 12 Jul 2022 14:02:10 +0800 Subject: [PATCH] docs: test highvolume_example.py --- docs/examples/python/highvolume_example.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/examples/python/highvolume_example.py b/docs/examples/python/highvolume_example.py index 7b0442c870..8a8e042266 100644 --- a/docs/examples/python/highvolume_example.py +++ b/docs/examples/python/highvolume_example.py @@ -9,6 +9,7 @@ logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format="%(asctime)s READ_TASK_COUNT = 1 WRITE_TASK_COUNT = 1 +QUEUE_SIZE = 1000 TABLE_COUNT = 1000 MAX_BATCH_SIZE = 3000 @@ -145,11 +146,14 @@ def set_global_config(): global WRITE_TASK_COUNT WRITE_TASK_COUNT = int(sys.argv[2]) if argc > 3: - global TABLE_COUNT - TABLE_COUNT = int(sys.argv[3]) + global QUEUE_SIZE + QUEUE_SIZE = int(sys.argv[3]) if argc > 4: + global TABLE_COUNT + TABLE_COUNT = int(sys.argv[4]) + if argc > 5: global MAX_BATCH_SIZE - MAX_BATCH_SIZE = int(sys.argv[4]) + MAX_BATCH_SIZE = int(sys.argv[5]) # ANCHOR: main @@ -163,7 +167,7 @@ def main(): task_queues: List[Queue] = [] for i in range(WRITE_TASK_COUNT): - queue = Queue(maxsize=100) + queue = Queue(maxsize=QUEUE_SIZE) task_queues.append(queue) p = Process(target=run_write_task, args=(i, queue)) p.start() -- GitLab