diff options
Diffstat (limited to 'src/wydawca.h')
-rw-r--r-- | src/wydawca.h | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/wydawca.h b/src/wydawca.h index 825f30b..0a926e6 100644 --- a/src/wydawca.h +++ b/src/wydawca.h @@ -63,6 +63,7 @@ void wy_set_cur_thread_name(char const *name); #define SP(s) ((s) ? (s) : "NONE") #define DEFAULT_FILE_SWEEP_TIME 300 +#define DEFAULT_STAT_REPORT_INTERVAL 3600 /* The range of directive versions we accept (major * 100 + minor) */ #define MIN_DIRECTIVE_VERSION 101 @@ -319,6 +320,7 @@ extern char *conffile; /* Configuration file name */ extern int syslog_include_prio; /* Syslog priority indication */ extern time_t file_sweep_time; /* Unlink stale file after this amount of time */ +extern time_t stat_report_interval; extern char *tar_command_name; /* Name of the tar command */ extern unsigned long print_stats; extern int archive_signatures; @@ -353,31 +355,18 @@ extern struct notification *default_notification; extern size_t spool_count; typedef unsigned WY_STAT_COUNTER; -WY_STAT_COUNTER *wy_get_stat_array(void); - -static inline WY_STAT_COUNTER * -wy_get_stat_slot(int what) -{ - return wy_get_stat_array() + what; -} - -static inline WY_STAT_COUNTER -wy_get_stat_counter(int what) -{ - return *wy_get_stat_slot(what); -} +void wydawca_stat_log(void); +void wydawca_stat_init(void); +void wydawca_stat_update(void); +void wydawca_stat_notify(int final); +void wydawca_stat_add(int what, size_t n); static inline void -increase_stat_counter(int what) +wydawca_stat_incr(int what) { - if (what >= WY_MAX_STAT) abort(); - ++*wy_get_stat_slot(what); + wydawca_stat_add(what, 1); } -int stat_mask_p(unsigned long mask); -void logstats(void); -void wydawca_stats_export(void); -void wydawca_stats_update(void); /* Utility functions */ char *safe_file_name(char *file_name); |