sources: add configurable limit for jitter

The maxjitter directive sets the maximum allowed jitter of the sources
to not be rejected by the source selection algorithm. This prevents
synchronisation with sources that have a small root distance, but their
time is too variable. By default, the maximum jitter is 1 second.
This commit is contained in:
Miroslav Lichvar
2016-12-07 09:40:43 +01:00
parent 68039e0d14
commit 8bbb8fa062
4 changed files with 28 additions and 1 deletions

11
conf.c
View File

@@ -90,6 +90,7 @@ static double max_drift = 500000.0; /* in ppm */
static double max_slew_rate = 1e6 / 12.0; /* in ppm */
static double max_distance = 3.0;
static double max_jitter = 1.0;
static double reselect_distance = 1e-4;
static double stratum_weight = 1e-3;
static double combine_limit = 3.0;
@@ -510,6 +511,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
parse_double(p, &max_distance);
} else if (!strcasecmp(command, "maxdrift")) {
parse_double(p, &max_drift);
} else if (!strcasecmp(command, "maxjitter")) {
parse_double(p, &max_jitter);
} else if (!strcasecmp(command, "maxsamples")) {
parse_int(p, &max_samples);
} else if (!strcasecmp(command, "maxslewrate")) {
@@ -1551,6 +1554,14 @@ CNF_GetMaxDistance(void)
/* ================================================== */
double
CNF_GetMaxJitter(void)
{
return max_jitter;
}
/* ================================================== */
double
CNF_GetReselectDistance(void)
{