]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
clientlog: extend serverstats counters to 64 bits
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Mar 2023 11:32:57 +0000 (12:32 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 30 Mar 2023 13:17:52 +0000 (15:17 +0200)
On a busy server the 32-bit counters included in the serverstats report
may overflow every few hours or days. Extend them to 64 bits.

clientlog.c
reports.h

index 611e75339e3d4dd2065c47491bf73589947a5c7b..c408e8d4b10525c1dbc643787285f18b00bcad38 100644 (file)
@@ -160,13 +160,13 @@ static NtpTimestampMap ntp_ts_map;
 #define MAX_NTP_TS NTP_TS_HARDWARE
 
 /* Global statistics */
-static uint32_t total_hits[MAX_SERVICES];
-static uint32_t total_drops[MAX_SERVICES];
-static uint32_t total_ntp_auth_hits;
-static uint32_t total_ntp_interleaved_hits;
-static uint32_t total_record_drops;
-static uint32_t total_ntp_rx_timestamps[MAX_NTP_TS + 1];
-static uint32_t total_ntp_tx_timestamps[MAX_NTP_TS + 1];
+static uint64_t total_hits[MAX_SERVICES];
+static uint64_t total_drops[MAX_SERVICES];
+static uint64_t total_ntp_auth_hits;
+static uint64_t total_ntp_interleaved_hits;
+static uint64_t total_record_drops;
+static uint64_t total_ntp_rx_timestamps[MAX_NTP_TS + 1];
+static uint64_t total_ntp_tx_timestamps[MAX_NTP_TS + 1];
 
 #define NSEC_PER_SEC 1000000000U
 
index 68164a67d6d7186d58febf2df2e0e5d959935adb..0150fc67cf822a5476b0112d0016a53bbf7e64a0 100644 (file)
--- a/reports.h
+++ b/reports.h
@@ -109,23 +109,23 @@ typedef struct {
 } RPT_ClientAccessByIndex_Report;
 
 typedef struct {
-  uint32_t ntp_hits;
-  uint32_t nke_hits;
-  uint32_t cmd_hits;
-  uint32_t ntp_drops;
-  uint32_t nke_drops;
-  uint32_t cmd_drops;
-  uint32_t log_drops;
-  uint32_t ntp_auth_hits;
-  uint32_t ntp_interleaved_hits;
-  uint32_t ntp_timestamps;
-  uint32_t ntp_span_seconds;
-  uint32_t ntp_daemon_rx_timestamps;
-  uint32_t ntp_daemon_tx_timestamps;
-  uint32_t ntp_kernel_rx_timestamps;
-  uint32_t ntp_kernel_tx_timestamps;
-  uint32_t ntp_hw_rx_timestamps;
-  uint32_t ntp_hw_tx_timestamps;
+  uint64_t ntp_hits;
+  uint64_t nke_hits;
+  uint64_t cmd_hits;
+  uint64_t ntp_drops;
+  uint64_t nke_drops;
+  uint64_t cmd_drops;
+  uint64_t log_drops;
+  uint64_t ntp_auth_hits;
+  uint64_t ntp_interleaved_hits;
+  uint64_t ntp_timestamps;
+  uint64_t ntp_span_seconds;
+  uint64_t ntp_daemon_rx_timestamps;
+  uint64_t ntp_daemon_tx_timestamps;
+  uint64_t ntp_kernel_rx_timestamps;
+  uint64_t ntp_kernel_tx_timestamps;
+  uint64_t ntp_hw_rx_timestamps;
+  uint64_t ntp_hw_tx_timestamps;
 } RPT_ServerStatsReport;
 
 typedef struct {