mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 22:35:06 -05:00
Add corrtimeratio directive
The corrtimeratio directive controls the ratio between the duration in which the clock is slewed for an average correction according to the source history and the interval in which the corrections are done (usually the NTP polling interval). Corrections larger than the average take less time and smaller corrections take more time, the amount of the correction and the correction time are inversely proportional. Increasing corrtimeratio makes the overall frequency error of the system clock smaller, but increases the overall time error as the corrections will take longer. By default, the ratio is 1, which means the duration of an average correction will be close to the update interval.
This commit is contained in:
11
reference.c
11
reference.c
@@ -56,6 +56,8 @@ static double our_root_dispersion;
|
||||
|
||||
static double max_update_skew;
|
||||
|
||||
static double correction_time_ratio;
|
||||
|
||||
/* Flag indicating that we are initialised */
|
||||
static int initialised = 0;
|
||||
|
||||
@@ -181,6 +183,8 @@ REF_Initialise(void)
|
||||
|
||||
max_update_skew = fabs(CNF_GetMaxUpdateSkew()) * 1.0e-6;
|
||||
|
||||
correction_time_ratio = CNF_GetCorrectionTimeRatio();
|
||||
|
||||
enable_local_stratum = CNF_AllowLocalReference(&local_stratum);
|
||||
|
||||
CNF_GetMakeStep(&make_step_limit, &make_step_threshold);
|
||||
@@ -619,13 +623,14 @@ REF_SetReference(int stratum,
|
||||
Define correction rate as the area of the region bounded by the graph of
|
||||
offset corrected in time. Set the rate so that the time needed to correct
|
||||
an offset equal to the current sourcestats stddev will be equal to the
|
||||
update interval (assuming linear adjustment). The offset and the
|
||||
time needed to make the correction are inversely proportional.
|
||||
update interval multiplied by the correction time ratio (assuming linear
|
||||
adjustment). The offset and the time needed to make the correction are
|
||||
inversely proportional.
|
||||
|
||||
This is only a suggestion and it's up to the system driver how the
|
||||
adjustment will be executed. */
|
||||
|
||||
correction_rate = 0.5 * offset_sd * update_interval;
|
||||
correction_rate = correction_time_ratio * 0.5 * offset_sd * update_interval;
|
||||
|
||||
/* Eliminate updates that are based on totally unreliable frequency
|
||||
information */
|
||||
|
||||
Reference in New Issue
Block a user