Count total number of NTP and command hits. Count also number of log
records that were replaced when the hash table couldn't be resized due
to the memory limit.
/* Flag indicating whether facility is turned on or not */
static int active;
+/* Global statistics */
+static uint32_t total_ntp_hits;
+static uint32_t total_cmd_hits;
+static uint32_t total_ntp_drops;
+static uint32_t total_cmd_drops;
+static uint32_t total_record_drops;
+
/* ================================================== */
static int expand_hashtable(void);
/* There is no other option, replace the oldest record */
record = oldest_record;
+ total_record_drops++;
break;
}
{
Record *record;
+ total_ntp_hits++;
+
if (!active)
return -1;
{
Record *record;
+ total_cmd_hits++;
+
if (!active)
return -1;
record->flags |= FLAG_NTP_DROPPED;
record->ntp_drops++;
+ total_ntp_drops++;
return 1;
}
}
record->cmd_drops++;
+ total_cmd_drops++;
return 1;
}