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.
This commit is contained in:
parent
a0e9b57d39
commit
2358ad6bbe
|
@ -104,9 +104,9 @@ def follow_node_log(config, node, lines=10):
|
||||||
API arguments: lines={lines}
|
API arguments: lines={lines}
|
||||||
API schema: {"name":"{nodename}","data":"{node_log}"}
|
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 = {
|
params = {
|
||||||
'lines': 500
|
'lines': 200
|
||||||
}
|
}
|
||||||
response = call_api(config, 'get', '/node/{node}/log'.format(node=node), params=params)
|
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='')
|
print('\n', end='')
|
||||||
|
|
||||||
while True:
|
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:
|
try:
|
||||||
params = {
|
params = {
|
||||||
'lines': 500
|
'lines': 200
|
||||||
}
|
}
|
||||||
response = call_api(config, 'get', '/node/{node}/log'.format(node=node), params=params)
|
response = call_api(config, 'get', '/node/{node}/log'.format(node=node), params=params)
|
||||||
new_node_log = response.json()['data']
|
new_node_log = response.json()['data']
|
||||||
|
|
|
@ -1215,9 +1215,9 @@ def follow_console_log(config, vm, lines=10):
|
||||||
API arguments: lines={lines}
|
API arguments: lines={lines}
|
||||||
API schema: {"name":"{vmname}","data":"{console_log}"}
|
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 = {
|
params = {
|
||||||
'lines': 500
|
'lines': 200
|
||||||
}
|
}
|
||||||
response = call_api(config, 'get', '/vm/{vm}/console'.format(vm=vm), params=params)
|
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='')
|
print(loglines, end='')
|
||||||
|
|
||||||
while True:
|
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:
|
try:
|
||||||
params = {
|
params = {
|
||||||
'lines': 500
|
'lines': 200
|
||||||
}
|
}
|
||||||
response = call_api(config, 'get', '/vm/{vm}/console'.format(vm=vm), params=params)
|
response = call_api(config, 'get', '/vm/{vm}/console'.format(vm=vm), params=params)
|
||||||
new_console_log = response.json()['data']
|
new_console_log = response.json()['data']
|
||||||
|
|
Loading…
Reference in New Issue