From 2358ad6bbe95085f0acc31809e0fd4ba9fa732cb Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 18 Jul 2021 20:23:45 -0400 Subject: [PATCH] Reduce the number of lines per call 500 was a lot every half second; 200 seems more reasonable. Even a fast kernel boot should generate < 200 lines in half a second. --- client-cli/pvc/cli_lib/node.py | 8 ++++---- client-cli/pvc/cli_lib/vm.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client-cli/pvc/cli_lib/node.py b/client-cli/pvc/cli_lib/node.py index 58751b79..136beb9e 100644 --- a/client-cli/pvc/cli_lib/node.py +++ b/client-cli/pvc/cli_lib/node.py @@ -104,9 +104,9 @@ def follow_node_log(config, node, lines=10): API arguments: lines={lines} API schema: {"name":"{nodename}","data":"{node_log}"} """ - # We always grab 500 to match the follow call, but only _show_ `lines` number + # We always grab 200 to match the follow call, but only _show_ `lines` number params = { - 'lines': 500 + 'lines': 200 } response = call_api(config, 'get', '/node/{node}/log'.format(node=node), params=params) @@ -123,10 +123,10 @@ def follow_node_log(config, node, lines=10): print('\n', end='') while True: - # Grab the next line set (500 is a reasonable number of lines per second; any more are skipped) + # Grab the next line set (200 is a reasonable number of lines per half-second; any more are skipped) try: params = { - 'lines': 500 + 'lines': 200 } response = call_api(config, 'get', '/node/{node}/log'.format(node=node), params=params) new_node_log = response.json()['data'] diff --git a/client-cli/pvc/cli_lib/vm.py b/client-cli/pvc/cli_lib/vm.py index cbf3ea7b..16a81a21 100644 --- a/client-cli/pvc/cli_lib/vm.py +++ b/client-cli/pvc/cli_lib/vm.py @@ -1215,9 +1215,9 @@ def follow_console_log(config, vm, lines=10): API arguments: lines={lines} API schema: {"name":"{vmname}","data":"{console_log}"} """ - # We always grab 500 to match the follow call, but only _show_ `lines` number + # We always grab 200 to match the follow call, but only _show_ `lines` number params = { - 'lines': 500 + 'lines': 200 } response = call_api(config, 'get', '/vm/{vm}/console'.format(vm=vm), params=params) @@ -1233,10 +1233,10 @@ def follow_console_log(config, vm, lines=10): print(loglines, end='') while True: - # Grab the next line set (500 is a reasonable number of lines per second; any more are skipped) + # Grab the next line set (200 is a reasonable number of lines per half-second; any more are skipped) try: params = { - 'lines': 500 + 'lines': 200 } response = call_api(config, 'get', '/vm/{vm}/console'.format(vm=vm), params=params) new_console_log = response.json()['data']