mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:35:06 -05:00
Base poll adjustment on number of sourcestats samples
Instead of following skew changes, adjust polling interval so that the number of measurements used in the regression algorithm remains close to a target value. It can be configured with a new polltarget option (6 by default).
This commit is contained in:
10
cmdparse.c
10
cmdparse.c
@@ -60,6 +60,7 @@ CPS_ParseNTPSourceAdd(const char *line, CPS_NTP_Source *src)
|
||||
src->params.auto_offline = 0;
|
||||
src->params.iburst = 0;
|
||||
src->params.min_stratum = SRC_DEFAULT_MINSTRATUM;
|
||||
src->params.poll_target = SRC_DEFAULT_POLLTARGET;
|
||||
src->params.sel_option = SRC_SelectNormal;
|
||||
|
||||
result = CPS_Success;
|
||||
@@ -165,6 +166,15 @@ CPS_ParseNTPSourceAdd(const char *line, CPS_NTP_Source *src)
|
||||
line += n;
|
||||
}
|
||||
|
||||
} else if (!strncasecmp(cmd, "polltarget", 10)) {
|
||||
if (sscanf(line, "%d%n", &src->params.poll_target, &n) != 1) {
|
||||
result = CPS_BadPolltarget;
|
||||
ok = 0;
|
||||
done = 1;
|
||||
} else {
|
||||
line += n;
|
||||
}
|
||||
|
||||
} else if (!strncasecmp(cmd, "noselect", 8)) {
|
||||
src->params.sel_option = SRC_SelectNoselect;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user