client: add smoothtime command
This commit is contained in:
parent
273da62aec
commit
36e8cb6530
2 changed files with 46 additions and 4 deletions
|
@ -3048,14 +3048,18 @@ falseticker or fail to select a source completely.
|
|||
|
||||
The smoothing process is independent from any slewing applied to the local
|
||||
system clock, but the accumulated offset and frequency for smoothing will be
|
||||
reset when the clock is corrected by step, e.g. by the @code{makestep}
|
||||
directive or command.
|
||||
reset when the clock is corrected by stepping, e.g. by the @code{makestep}
|
||||
directive or command. The process can be reset without stepping the clock
|
||||
by the @code{smoothtime reset} command (@pxref{smoothtime command}).
|
||||
|
||||
The directive takes two arguments, the maximum frequency offset of the smoothed
|
||||
time to the tracked NTP time (in ppm) and the maximum rate at which the
|
||||
frequency offset is allowed to change (in ppm per second). The smoothing
|
||||
process is activated when 1/10000 of the estimated skew of the local clock
|
||||
falls below the maximum rate of frequency change.
|
||||
process is activated automatically when 1/10000 of the estimated skew of the
|
||||
local clock falls below the maximum rate of frequency change. It can be
|
||||
activated explicitly by the @code{smoothtime activate} command, which is
|
||||
particularly useful when the clock is synchronized only with manual input
|
||||
since the skew can't be small enough to activate the process.
|
||||
|
||||
An example suitable for clients using @code{ntpd} and 1024 second polling
|
||||
interval could be
|
||||
|
@ -3346,6 +3350,7 @@ interface.
|
|||
* rtcdata command:: Display RTC parameters
|
||||
* settime command:: Provide a manual input of the current time
|
||||
* smoothing command:: Display current time smoothing state
|
||||
* smoothtime command:: Reset/activate server time smoothing
|
||||
* sources command:: Display information about the current set of sources
|
||||
* sourcestats command:: Display the rate & offset estimation performance of sources
|
||||
* timeout command:: Set initial response timeout
|
||||
|
@ -4367,6 +4372,21 @@ This field shows how long ago was the time smoothing process updated, e.g.
|
|||
The time it would take for the smoothing process to get to zero offset and
|
||||
frequency if there were no more updates.
|
||||
@end table
|
||||
@c }}}
|
||||
@c {{{ smoothtime
|
||||
@node smoothtime command
|
||||
@subsubsection smoothtime
|
||||
The @code{smoothtime} command can be used to reset or activate the server time
|
||||
smoothing process if it is configured with the @code{smoothtime} directive
|
||||
(@pxref{smoothtime directive}).
|
||||
|
||||
The syntax is as follows
|
||||
|
||||
@example
|
||||
smoothtime reset
|
||||
smoothtime activate
|
||||
@end example
|
||||
|
||||
@c }}}
|
||||
@c {{{ sources
|
||||
@node sources command
|
||||
|
|
22
client.c
22
client.c
|
@ -1185,6 +1185,7 @@ give_help(void)
|
|||
printf("rtcdata : Print current RTC performance parameters\n");
|
||||
printf("settime <date/time (e.g. Nov 21, 1997 16:30:05 or 16:30:05)> : Manually set the daemon time\n");
|
||||
printf("smoothing : Display current time smoothing state\n");
|
||||
printf("smoothtime reset|activate : Reset/activate time smoothing\n");
|
||||
printf("sources [-v] : Display information about current sources\n");
|
||||
printf("sourcestats [-v] : Display estimation information about current sources\n");
|
||||
printf("tracking : Display system time information\n");
|
||||
|
@ -2003,6 +2004,25 @@ process_cmd_smoothing(char *line)
|
|||
|
||||
/* ================================================== */
|
||||
|
||||
static int
|
||||
process_cmd_smoothtime(CMD_Request *msg, const char *line)
|
||||
{
|
||||
if (!strcmp(line, "reset")) {
|
||||
msg->data.smoothtime.option = htonl(REQ_SMOOTHTIME_RESET);
|
||||
} else if (!strcmp(line, "activate")) {
|
||||
msg->data.smoothtime.option = htonl(REQ_SMOOTHTIME_ACTIVATE);
|
||||
} else {
|
||||
fprintf(stderr, "Invalid syntax for smoothtime command\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
msg->command = htons(REQ_SMOOTHTIME);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
static int
|
||||
process_cmd_rtcreport(char *line)
|
||||
{
|
||||
|
@ -2577,6 +2597,8 @@ process_line(char *line, int *quit)
|
|||
} else if (!strcmp(command, "smoothing")) {
|
||||
do_normal_submit = 0;
|
||||
ret = process_cmd_smoothing(line);
|
||||
} else if (!strcmp(command, "smoothtime")) {
|
||||
do_normal_submit = process_cmd_smoothtime(&tx_message, line);
|
||||
} else if (!strcmp(command, "sources")) {
|
||||
do_normal_submit = 0;
|
||||
ret = process_cmd_sources(line);
|
||||
|
|
Loading…
Reference in a new issue