static int cmd_port = DEFAULT_CANDM_PORT;
+static int raw_measurements = 0;
static int do_log_measurements = 0;
static int do_log_statistics = 0;
static int do_log_tracking = 0;
log_name = line;
line = CPS_SplitWord(line);
if (*log_name) {
- if (!strcmp(log_name, "measurements")) {
+ if (!strcmp(log_name, "rawmeasurements")) {
+ do_log_measurements = 1;
+ raw_measurements = 1;
+ } else if (!strcmp(log_name, "measurements")) {
do_log_measurements = 1;
} else if (!strcmp(log_name, "statistics")) {
do_log_statistics = 1;
/* ================================================== */
int
-CNF_GetLogMeasurements(void)
+CNF_GetLogMeasurements(int *raw)
{
+ *raw = raw_measurements;
return do_log_measurements;
}
extern char *CNF_GetLogDir(void);
extern char *CNF_GetDumpDir(void);
extern int CNF_GetLogBanner(void);
-extern int CNF_GetLogMeasurements(void);
+extern int CNF_GetLogMeasurements(int *raw);
extern int CNF_GetLogStatistics(void);
extern int CNF_GetLogTracking(void);
extern int CNF_GetLogRtc(void);
directive. A banner is periodically written to the files to indicate the
meanings of the columns.
+
-*measurements*:::
+*rawmeasurements*:::
This option logs the raw NTP measurements and related information to a file
-called _measurements.log_. An example line (which actually appears as a single
-line in the file) from the log file is shown below.
+called _measurements.log_. An entry is made for each packet received from the
+source. This can be useful when debugging a problem. An example line (which
+actually appears as a single line in the file) from the log file is shown
+below.
+
----
2016-11-09 05:40:50 203.0.113.15 N 2 111 111 1111 10 10 1.0 \
. Source of the local receive timestamp
(_D_=daemon, _K_=kernel, _H_=hardware). [K]
+
+*measurements*:::
+This option is identical to the *rawmeasurements* option, except it logs only
+valid measurements from synchronised sources, i.e. measurements which passed
+the RFC 5905 tests 1 through 7. This can be useful for producing graphs of the
+source's performance.
++
*statistics*:::
This option logs information about the regression processing to a file called
_statistics.log_. An example line (which actually appears as a single line in
/* ================================================== */
static LOG_FileID logfileid;
+static int log_raw_measurements;
/* ================================================== */
/* Enumeration used for remembering the operating mode of one of the
do_size_checks();
do_time_checks();
- logfileid = CNF_GetLogMeasurements() ? LOG_FileOpen("measurements",
+ logfileid = CNF_GetLogMeasurements(&log_raw_measurements) ? LOG_FileOpen("measurements",
" Date (UTC) Time IP Address L St 123 567 ABCD LP RP Score Offset Peer del. Peer disp. Root del. Root disp. Refid MTxRx")
: -1;
}
/* Do measurement logging */
- if (logfileid != -1) {
+ if (logfileid != -1 && (log_raw_measurements || synced_packet)) {
LOG_FileWrite(logfileid, "%s %-15s %1c %2d %1d%1d%1d %1d%1d%1d %1d%1d%1d%d %2d %2d %4.2f %10.3e %10.3e %10.3e %10.3e %10.3e %08"PRIX32" %1d%1c %1c %1c",
UTI_TimeToLogForm(sample_time.tv_sec),
UTI_IPToString(&inst->remote_addr.ip_addr),