Remove samples option default
Stop pretending 3600 is a meaningful default for the --samples command line option. That hasn't been the case since the history buffer was reduced to 900 samples. The default behavior if loop interval not set is now to process all samples, which was what effectively what it was doing, anyway.
This commit is contained in:
parent
9ca1a8a51c
commit
c0f7dd5096
1 changed files with 4 additions and 5 deletions
|
@ -22,7 +22,6 @@ import grpc
|
||||||
import starlink_grpc
|
import starlink_grpc
|
||||||
|
|
||||||
BRACKETS_RE = re.compile(r"([^[]*)(\[((\d+),|)(\d*)\]|)$")
|
BRACKETS_RE = re.compile(r"([^[]*)(\[((\d+),|)(\d*)\]|)$")
|
||||||
SAMPLES_DEFAULT = 3600
|
|
||||||
LOOP_TIME_DEFAULT = 0
|
LOOP_TIME_DEFAULT = 0
|
||||||
STATUS_MODES = ["status", "obstruction_detail", "alert_detail"]
|
STATUS_MODES = ["status", "obstruction_detail", "alert_detail"]
|
||||||
HISTORY_STATS_MODES = [
|
HISTORY_STATS_MODES = [
|
||||||
|
@ -79,13 +78,13 @@ def create_arg_parser(output_description, bulk_history=True):
|
||||||
if bulk_history:
|
if bulk_history:
|
||||||
sample_help = ("Number of data samples to parse; normally applies to first loop "
|
sample_help = ("Number of data samples to parse; normally applies to first loop "
|
||||||
"iteration only, default: all in bulk mode, loop interval if loop "
|
"iteration only, default: all in bulk mode, loop interval if loop "
|
||||||
"interval set, else " + str(SAMPLES_DEFAULT))
|
"interval set, else all available samples")
|
||||||
no_counter_help = ("Don't track sample counter across loop iterations in non-bulk "
|
no_counter_help = ("Don't track sample counter across loop iterations in non-bulk "
|
||||||
"modes; keep using samples option value instead")
|
"modes; keep using samples option value instead")
|
||||||
else:
|
else:
|
||||||
sample_help = ("Number of data samples to parse; normally applies to first loop "
|
sample_help = ("Number of data samples to parse; normally applies to first loop "
|
||||||
"iteration only, default: loop interval, if set, else " +
|
"iteration only, default: loop interval, if set, else all available " +
|
||||||
str(SAMPLES_DEFAULT))
|
"samples")
|
||||||
no_counter_help = ("Don't track sample counter across loop iterations; keep using "
|
no_counter_help = ("Don't track sample counter across loop iterations; keep using "
|
||||||
"samples option value instead")
|
"samples option value instead")
|
||||||
group.add_argument("-s", "--samples", type=int, help=sample_help)
|
group.add_argument("-s", "--samples", type=int, help=sample_help)
|
||||||
|
@ -130,7 +129,7 @@ def run_arg_parser(parser, need_id=False, no_stdout_errors=False):
|
||||||
opts.bulk_mode = "bulk_history" in opts.mode
|
opts.bulk_mode = "bulk_history" in opts.mode
|
||||||
|
|
||||||
if opts.samples is None:
|
if opts.samples is None:
|
||||||
opts.samples = int(opts.loop_interval) if opts.loop_interval >= 1.0 else SAMPLES_DEFAULT
|
opts.samples = int(opts.loop_interval) if opts.loop_interval >= 1.0 else -1
|
||||||
opts.bulk_samples = -1
|
opts.bulk_samples = -1
|
||||||
else:
|
else:
|
||||||
opts.bulk_samples = opts.samples
|
opts.bulk_samples = opts.samples
|
||||||
|
|
Loading…
Reference in a new issue