aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-04-27 16:50:16 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-04-27 16:50:16 +0300
commit3ababf4edb89be0b164d8e9cb1cad5b009de9778 (patch)
tree9e70971c38ff9b402b02708bbce5a9f9fdeccef3
parent9dff021e31a300dcd5eda941d9e4992a6a8e465a (diff)
downloadwydawca-3ababf4edb89be0b164d8e9cb1cad5b009de9778.tar.gz
wydawca-3ababf4edb89be0b164d8e9cb1cad5b009de9778.tar.bz2
Replace the "finish" event with "statistics".
-rw-r--r--NEWS8
-rw-r--r--doc/wydawca.texi23
-rw-r--r--etc/wydawca.conf8
-rw-r--r--include/wydawca/wydawca.h2
-rw-r--r--modules/logstat/mod_logstat.c2
-rw-r--r--modules/mailutils/mod_mailutils.c2
-rw-r--r--src/config.c3
-rw-r--r--src/spool.c4
-rw-r--r--src/timer.c2
-rw-r--r--src/wydawca.h2
10 files changed, 35 insertions, 21 deletions
diff --git a/NEWS b/NEWS
index 01c8091..ebe721e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Wydawca NEWS -- history of user-visible changes. 2020-04-26
+Wydawca NEWS -- history of user-visible changes. 2020-04-27
See the end of file for copying conditions.
Please send Wydawca bug reports to <bug-wydawca@gnu.org.ua>.
@@ -75,6 +75,12 @@ notification connections. Default is 16.
This new statement configures the maximum idle timeout of an
upload notification connection. Default is 10 seconds.
+** stat-report-interval statement
+
+** The "statistics" event.
+
+New event "statistics" replaces the legacy "finish" event.
+
** spool timers
References to particular spool timers in expansion strings have the
diff --git a/doc/wydawca.texi b/doc/wydawca.texi
index 7eac388..349d9ba 100644
--- a/doc/wydawca.texi
+++ b/doc/wydawca.texi
@@ -2543,10 +2543,17 @@ uploader.
detailed description.
@kwindex finish
-@item finish
- This event is reported at the end of the wydawca job, when all
-spools have been processed. It is normally used to produce final
-statistic reports. @xref{statreports}, for an example.
+@kwindex statistics
+@item statistics
+ This event produces statistics about the recent jobs performed
+by @command{wydawca}. In daemon mode, it is scheduled periodically
+as controlled by @code{stat-report-interval} statement. In cron mode
+it is emitted when all spools have been processed.
+
+For compatibility with @command{wydawca} versions prior to 3.1.95, the
+event name @samp{finish} can be used instead of @samp{statistics}.
+
+@xref{statreports}, for an example.
See also @ref{mod_logstat}.
@end table
@end deffn
@@ -2794,7 +2801,7 @@ following statement:
@smallexample
notify-event @{
- event finish;
+ event statistrics;
module mailutils;
@}
@end smallexample
@@ -3201,7 +3208,7 @@ module-init mailutils @{
@}
notify-event @{
- event finish;
+ event statistics;
module mailutils;
@}
@@ -3247,7 +3254,7 @@ The simplest configuration for this module is:
module logstat mod_logstat.so;
notify-event @{
- event finish;
+ event statistics;
module logstat;
@}
@end group
@@ -3257,7 +3264,7 @@ This will produce on the default logging channel the detailed
statistics, as discussed in @ref{statistics}.
There is no specific @code{module-init} statements. The module should
-be called from @code{notify-event} block on the @samp{finish} event.
+be called from @code{notify-event} block on the @samp{statistics} event.
The module's @code{module-config} statement can contain the following
statements:
diff --git a/etc/wydawca.conf b/etc/wydawca.conf
index bd87c2b..552dd27 100644
--- a/etc/wydawca.conf
+++ b/etc/wydawca.conf
@@ -93,10 +93,10 @@ module-init mailutils {
mail-statistics {
statistics all;
message <<EOT
-Subject: Wydawca stats
+Subject: Wydawca statistics
-This is to notify you that the run of wydawca on ${date}
-caused the following results:
+Please find below the statistics summary of the tasks performed
+by the daemon:
errors ............................. ${stat:errors}
warning ............................ ${stat:warnings}
@@ -306,7 +306,7 @@ EOT;
}
notify-event {
- event finish;
+ event statistics;
module mailutils;
}
diff --git a/include/wydawca/wydawca.h b/include/wydawca/wydawca.h
index 23e6445..e2cc110 100644
--- a/include/wydawca/wydawca.h
+++ b/include/wydawca/wydawca.h
@@ -54,7 +54,7 @@ enum wy_event {
wy_ev_bad_directive_signature,
wy_ev_bad_detached_signature,
wy_ev_check_fail,
- wy_ev_finish,
+ wy_ev_stat,
WY_N_EVENT
};
diff --git a/modules/logstat/mod_logstat.c b/modules/logstat/mod_logstat.c
index a0ece89..c918cdc 100644
--- a/modules/logstat/mod_logstat.c
+++ b/modules/logstat/mod_logstat.c
@@ -86,7 +86,7 @@ wy_notify(void *data, int ev, wy_triplet_t const *trp)
struct grecs_list_entry *ep;
char *text;
- if (ev != wy_ev_finish || !wy_stat_mask_p(stat_mask))
+ if (ev != wy_ev_stat || !wy_stat_mask_p(stat_mask))
return;
if (log_msg) {
diff --git a/modules/mailutils/mod_mailutils.c b/modules/mailutils/mod_mailutils.c
index 759fa14..2ca231d 100644
--- a/modules/mailutils/mod_mailutils.c
+++ b/modules/mailutils/mod_mailutils.c
@@ -819,7 +819,7 @@ wy_notify(void *data, int ev, wy_triplet_t *trp)
if (trp)
t_notify(evt, ev, trp);
- else if (ev == wy_ev_finish)
+ else if (ev == wy_ev_stat)
mail_stats(evt);
}
diff --git a/src/config.c b/src/config.c
index ee9f0c3..f213fc7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -216,7 +216,8 @@ static struct keyword event_tab[] = {
{ "bad-directive-signature", wy_ev_bad_directive_signature },
{ "bad-detached-signature", wy_ev_bad_detached_signature },
{ "check-failure", wy_ev_check_fail },
- { "finish", wy_ev_finish },
+ { "statistics", wy_ev_stat },
+ { "finish", wy_ev_stat },
{ NULL }
};
diff --git a/src/spool.c b/src/spool.c
index 39ddc7b..2c01cc4 100644
--- a/src/spool.c
+++ b/src/spool.c
@@ -260,9 +260,9 @@ notify(const NOTIFYQ *nq, struct wy_triplet *t, enum wy_event e)
}
void
-notify_finish(void)
+notify_stat(void)
{
- notify(&default_notification, NULL, wy_ev_finish);
+ notify(&default_notification, NULL, wy_ev_stat);
}
void
diff --git a/src/timer.c b/src/timer.c
index 2085d23..1de7cfb 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -274,7 +274,7 @@ wy_thr_stat(void *ptr)
ts.tv_sec += stat_report_interval;
pthread_cond_timedwait(&global_stats_cond, &global_stats_mutex, &ts);
wydawca_stat_log();
- notify_finish();
+ notify_stat();
wydawca_stat_reset();
}
pthread_mutex_unlock(&global_stats_mutex);
diff --git a/src/wydawca.h b/src/wydawca.h
index 7fd8a02..5fbb106 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -284,7 +284,7 @@ struct spool {
void notify(const NOTIFYQ *, struct wy_triplet *, enum wy_event);
void spool_notify_flush(struct spool *sp);
-void notify_finish(void);
+void notify_stat(void);
/* Modules */

Return to:

Send suggestions and report system problems to the System administrator.