mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 23:45:06 -05:00
Limit sources included in combining
Combine only sources whose distance is shorter than distance of the selected source multiplied by the value of combinelimit and their estimated frequencies are close to the frequency of the selected source. Add outlyer status for sources which are selectable, but not included in the combining. The status is displayed as '-' in the chronyc sources output.
This commit is contained in:
23
conf.c
23
conf.c
@@ -66,6 +66,7 @@ static void parse_clientloglimit(char *);
|
||||
static void parse_cmdallow(char *);
|
||||
static void parse_cmddeny(char *);
|
||||
static void parse_cmdport(char *);
|
||||
static void parse_combinelimit(char *);
|
||||
static void parse_commandkey(char *);
|
||||
static void parse_corrtimeratio(char *);
|
||||
static void parse_deny(char *);
|
||||
@@ -126,6 +127,7 @@ static double max_clock_error = 1.0; /* in ppm */
|
||||
|
||||
static double reselect_distance = 1e-4;
|
||||
static double stratum_weight = 1.0;
|
||||
static double combine_limit = 3.0;
|
||||
|
||||
static int cmd_port = DEFAULT_CANDM_PORT;
|
||||
|
||||
@@ -374,6 +376,8 @@ CNF_ReadFile(const char *filename)
|
||||
parse_cmddeny(p);
|
||||
} else if (!strcasecmp(command, "cmdport")) {
|
||||
parse_cmdport(p);
|
||||
} else if (!strcasecmp(command, "combinelimit")) {
|
||||
parse_combinelimit(p);
|
||||
} else if (!strcasecmp(command, "commandkey")) {
|
||||
parse_commandkey(p);
|
||||
} else if (!strcasecmp(command, "corrtimeratio")) {
|
||||
@@ -757,6 +761,17 @@ parse_stratumweight(char *line)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
static void
|
||||
parse_combinelimit(char *line)
|
||||
{
|
||||
check_number_of_args(line, 1);
|
||||
if (sscanf(line, "%lf", &combine_limit) != 1) {
|
||||
command_parse_error();
|
||||
}
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
static void
|
||||
parse_driftfile(char *line)
|
||||
{
|
||||
@@ -1630,6 +1645,14 @@ CNF_GetStratumWeight(void)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
double
|
||||
CNF_GetCombineLimit(void)
|
||||
{
|
||||
return combine_limit;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
CNF_GetManualEnabled(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user