Base poll adjustment on number of sourcestats samples

Instead of following skew changes, adjust polling interval so that the
number of measurements used in the regression algorithm remains close to
a target value. It can be configured with a new polltarget option
(6 by default).
This commit is contained in:
Miroslav Lichvar
2010-10-13 16:49:28 +02:00
parent d9596334c3
commit 7a6ee1d729
12 changed files with 88 additions and 50 deletions

View File

@@ -936,6 +936,11 @@ process_cmd_add_server_or_peer(CMD_Request *msg, char *line)
break;
}
if (data.params.poll_target != SRC_DEFAULT_POLLTARGET) {
fprintf(stderr, "Option polltarget not supported\n");
break;
}
msg->data.ntp_source.port = htonl((unsigned long) data.port);
UTI_IPHostToNetwork(&data.ip_addr, &msg->data.ntp_source.ip_addr);
msg->data.ntp_source.minpoll = htonl(data.params.minpoll);
@@ -983,6 +988,9 @@ process_cmd_add_server_or_peer(CMD_Request *msg, char *line)
case CPS_BadMinstratum:
fprintf(stderr, "Unreadable minstratum value\n");
break;
case CPS_BadPolltarget:
fprintf(stderr, "Unreadable polltarget value\n");
break;
}
return result;