chiark / gitweb /
Accumulate backlog counts rather than reporting every file
[innduct.git] / innduct.h
index 78f06a8b762e5fc3ec51ea21f2d77f156b98ec3e..fc04d8a6688d93ba10c65d352e5ccc57f54077ff 100644 (file)
--- a/innduct.h
+++ b/innduct.h
@@ -176,6 +176,7 @@ extern int backlog_spontrescan_periods;
 extern int spontaneous_flush_periods;
 extern int max_separated_periods;
 extern int need_activity_periods;
+extern int stats_log_periods;
 extern int lowvol_thresh;
 extern int lowvol_periods;
 
@@ -217,6 +218,10 @@ typedef enum {
   RCI_max
 } ResultCountIndex;
 
+typedef enum {
+  read_ok, read_blank, read_err, nooffer_missing,
+  ECI_max
+} EventCountIndex;
 
 /*----- transmission buffers -----*/
 
@@ -236,6 +241,11 @@ struct XmitDetails {
 
 /*----- core operational data structure types -----*/
 
+typedef struct {
+  int results[art_MaxState][RCI_max];
+  int events[ECI_max];
+} Counts;
+
 struct InputFile {
   /* This is also an instance of struct oop_readable */
   struct oop_readable readable; /* first */
@@ -253,8 +263,7 @@ struct InputFile {
   long inprogress; /* includes queue.count and also articles in conns */
   long autodefer; /* -1 means not doing autodefer */
 
-  int counts[art_MaxState][RCI_max];
-  int readcount_ok, readcount_blank, readcount_err, count_nooffer_missing;
+  Counts counts;
   char path[];
 };
 
@@ -433,6 +442,7 @@ void statemc_period_poll(void);
 void statemc_lock(void);
 void init_signals(void);
 void statemc_init(void);
+void showstats(void);
 
 #define SMS(newstate, periods, why) \
    (statemc_setstate(sm_##newstate,(periods),#newstate,(why)))
@@ -472,7 +482,7 @@ extern pid_t inndcomm_child;
 
 /*========== general operational variables ==========*/
 
-/* innduct.c */
+/* duct.c */
 extern oop_source *loop;
 extern ConnList conns;
 extern char *path_lock, *path_flushing, *path_defer, *path_dump;
@@ -481,11 +491,14 @@ extern pid_t self_pid;
 extern int *lowvol_perperiod;
 extern int lowvol_circptr;
 extern int lowvol_total; /* does not include current period */
+extern int until_stats_log;
 
 /* statemc.c */
 extern StateMachineState sms;
 extern int until_flush;
 extern InputFile *main_input_file, *flushing_input_file, *backlog_input_file;
+extern Counts backlog_counts;
+extern int backlog_counts_report;
 extern FILE *defer;
 extern int until_connect, until_backlog_nextscan;
 extern double accept_proportion;