@item @code{password}
@item @code{quit}
@item @code{rtcdata}
+@item @code{smoothing}
@item @code{sources}
@item @code{sourcestats}
@item @code{tracking}
* retries command:: Set maximum number of retries
* rtcdata command:: Display RTC parameters
* settime command:: Provide a manual input of the current time
+* smoothing command:: Display current time smoothing state
* 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
For a full description of @code{getdate}, get hold of the getdate
documentation (bundled, for example, with the source for GNU tar).
@c }}}
+@c {{{ smoothing
+@node smoothing command
+@subsubsection smoothing
+The @code{smoothing} command displays the current state of the NTP server time
+smoothing. An example of the output is shown below.
+
+@example
+Active : Yes
+Offset : +1.000268817 seconds
+Frequency : -0.142859 ppm
+Wander : -0.010000 ppm per second
+Last update : 17.8 seconds ago
+Remaining time : 19988.4 seconds
+@end example
+
+The fields are explained as follows.
+
+@table @code
+@item Active
+This shows if the server time smoothing is currently active. Possible values
+are @code{Yes} and @code{No}. If the @code{leaponly} option is included in the
+@code{smoothtime} directive, @code{(leap second only)} will be shown on the
+line.
+
+@item Offset
+This is the current offset applied to the time sent to NTP clients. Positive
+value means the clients are getting time that's ahead of true time.
+
+@item Frequency
+The current frequency offset of the served time. Negative value means the time
+observed by clients is running slower than true time.
+
+@item Wander
+The current frequency wander of the served time. Negative value means the time
+observed by clients is slowing down.
+
+@item Last update
+This field shows how long ago was the time smoothing process updated, e.g.
+@code{chronyd} accumulated a new measurement.
+
+@item Remaining time
+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 {{{ sources
@node sources command
@subsubsection sources
printf("reselect : Reselect synchronisation source\n");
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("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");
}
/* ================================================== */
+static int
+process_cmd_smoothing(char *line)
+{
+ CMD_Request request;
+ CMD_Reply reply;
+ uint32_t flags;
+ double offset;
+ double freq_ppm;
+ double wander_ppm;
+ double last_update_ago;
+ double remaining_time;
+
+ request.command = htons(REQ_SMOOTHING);
+
+ if (request_reply(&request, &reply, RPY_SMOOTHING, 0)) {
+ flags = ntohl(reply.data.smoothing.flags);
+ offset = UTI_FloatNetworkToHost(reply.data.smoothing.offset);
+ freq_ppm = UTI_FloatNetworkToHost(reply.data.smoothing.freq_ppm);
+ wander_ppm = UTI_FloatNetworkToHost(reply.data.smoothing.wander_ppm);
+ last_update_ago = UTI_FloatNetworkToHost(reply.data.smoothing.last_update_ago);
+ remaining_time = UTI_FloatNetworkToHost(reply.data.smoothing.remaining_time);
+
+ printf("Active : %s%s\n",
+ flags & RPY_SMT_FLAG_ACTIVE ? "Yes" : "No",
+ flags & RPY_SMT_FLAG_LEAPONLY ? " (leap second only)" : "");
+ printf("Offset : %+.9f seconds\n", offset);
+ printf("Frequency : %+.6f ppm\n", freq_ppm);
+ printf("Wander : %+.6f ppm per second\n", wander_ppm);
+ printf("Last update : %.1f seconds ago\n", last_update_ago);
+ printf("Remaining time : %.1f seconds\n", remaining_time);
+ return 1;
+ }
+
+ return 0;
+}
+
+/* ================================================== */
+
static int
process_cmd_rtcreport(char *line)
{
} else if (!strcmp(command, "settime")) {
do_normal_submit = 0;
ret = process_cmd_settime(line);
+ } else if (!strcmp(command, "smoothing")) {
+ do_normal_submit = 0;
+ ret = process_cmd_smoothing(line);
} else if (!strcmp(command, "sources")) {
do_normal_submit = 0;
ret = process_cmd_sources(line);