mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
sourcestats: add function to correct accumulated offsets
This will be needed to follow server time corrections in order to better estimate frequency.
This commit is contained in:
@@ -779,6 +779,22 @@ SST_SlewSamples(SST_Stats inst, struct timespec *when, double dfreq, double doff
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
SST_CorrectOffset(SST_Stats inst, double doffset)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!inst->n_samples)
|
||||
return;
|
||||
|
||||
for (i = -inst->runs_samples; i < inst->n_samples; i++)
|
||||
inst->offsets[get_runsbuf_index(inst, i)] += doffset;
|
||||
|
||||
inst->estimated_offset += doffset;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
SST_AddDispersion(SST_Stats inst, double dispersion)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user