mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 04:35:06 -05:00
sourcestats: use constant for required number of samples
This commit is contained in:
@@ -698,7 +698,8 @@ SST_GetSelectionData(SST_Stats inst, struct timespec *now,
|
|||||||
|
|
||||||
/* If maxsamples is too small to have a successful regression, enable the
|
/* If maxsamples is too small to have a successful regression, enable the
|
||||||
selection as a special case for a fast update/print-once reference mode */
|
selection as a special case for a fast update/print-once reference mode */
|
||||||
if (!*select_ok && inst->n_samples < 3 && inst->n_samples == inst->max_samples) {
|
if (!*select_ok && inst->n_samples < MIN_SAMPLES_FOR_REGRESS &&
|
||||||
|
inst->n_samples == inst->max_samples) {
|
||||||
*std_dev = CNF_GetMaxJitter();
|
*std_dev = CNF_GetMaxJitter();
|
||||||
*select_ok = 1;
|
*select_ok = 1;
|
||||||
}
|
}
|
||||||
@@ -814,7 +815,7 @@ SST_PredictOffset(SST_Stats inst, struct timespec *when)
|
|||||||
{
|
{
|
||||||
double elapsed;
|
double elapsed;
|
||||||
|
|
||||||
if (inst->n_samples < 3) {
|
if (inst->n_samples < MIN_SAMPLES_FOR_REGRESS) {
|
||||||
/* We don't have any useful statistics, and presumably the poll
|
/* We don't have any useful statistics, and presumably the poll
|
||||||
interval is minimal. We can't do any useful prediction other
|
interval is minimal. We can't do any useful prediction other
|
||||||
than use the latest sample or zero if we don't have any samples */
|
than use the latest sample or zero if we don't have any samples */
|
||||||
|
|||||||
Reference in New Issue
Block a user