diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2012-08-24 18:21:07 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2012-08-24 18:21:07 +0000 |
commit | 4901165beebbdeeb15213e0a31103c449e31ad2c (patch) | |
tree | e6a9109f2a38bd25af52bb5f6c9b1d376701accc /usr.sbin | |
parent | d1d1625bf42f7ddfe218e5216044083f95fec5c6 (diff) |
add stat counter for the number of envelopes inflight.
ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/scheduler.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/scheduler.c b/usr.sbin/smtpd/scheduler.c index 2a4d7928203..f3b4d933f03 100644 --- a/usr.sbin/smtpd/scheduler.c +++ b/usr.sbin/smtpd/scheduler.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scheduler.c,v 1.15 2012/08/21 13:13:17 eric Exp $ */ +/* $OpenBSD: scheduler.c,v 1.16 2012/08/24 18:21:06 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -101,6 +101,7 @@ scheduler_imsg(struct imsgev *iev, struct imsg *imsg) log_trace(TRACE_SCHEDULER, "scheduler: deleting evp:%016" PRIx64 " (ok)", id); backend->delete(id); + stat_decrement("scheduler.inflight"); scheduler_reset_events(); return; @@ -110,6 +111,7 @@ scheduler_imsg(struct imsgev *iev, struct imsg *imsg) "scheduler: updating evp:%016" PRIx64, e->id); scheduler_info(&si, e); backend->update(&si); + stat_decrement("scheduler.inflight"); scheduler_reset_events(); return; @@ -118,6 +120,7 @@ scheduler_imsg(struct imsgev *iev, struct imsg *imsg) log_trace(TRACE_SCHEDULER, "scheduler: deleting evp:%016" PRIx64 " (fail)", id); backend->delete(id); + stat_decrement("scheduler.inflight"); scheduler_reset_events(); return; @@ -126,6 +129,7 @@ scheduler_imsg(struct imsgev *iev, struct imsg *imsg) log_trace(TRACE_SCHEDULER, "scheduler: deleting evp:%016" PRIx64 " (loop)", id); backend->delete(id); + stat_decrement("scheduler.inflight"); scheduler_reset_events(); return; @@ -351,6 +355,7 @@ scheduler_process_remove(struct scheduler_batch *batch) e->id); imsg_compose_event(env->sc_ievs[PROC_QUEUE], IMSG_QUEUE_REMOVE, 0, 0, -1, &e->id, sizeof e->id); + stat_increment("scheduler.removed"); free(e); } } @@ -367,6 +372,7 @@ scheduler_process_expire(struct scheduler_batch *batch) backend->delete(e->id); imsg_compose_event(env->sc_ievs[PROC_QUEUE], IMSG_QUEUE_EXPIRE, 0, 0, -1, &e->id, sizeof e->id); + stat_increment("scheduler.expired"); free(e); } } @@ -382,6 +388,7 @@ scheduler_process_bounce(struct scheduler_batch *batch) e->id); imsg_compose_event(env->sc_ievs[PROC_QUEUE], IMSG_SMTP_ENQUEUE, 0, 0, -1, &e->id, sizeof e->id); + stat_increment("scheduler.inflight"); free(e); } } @@ -397,6 +404,7 @@ scheduler_process_mda(struct scheduler_batch *batch) e->id); imsg_compose_event(env->sc_ievs[PROC_QUEUE], IMSG_MDA_SESS_NEW, 0, 0, -1, &e->id, sizeof e->id); + stat_increment("scheduler.inflight"); free(e); } } @@ -415,6 +423,7 @@ scheduler_process_mta(struct scheduler_batch *batch) e->id); imsg_compose_event(env->sc_ievs[PROC_QUEUE], IMSG_BATCH_APPEND, 0, 0, -1, &e->id, sizeof e->id); + stat_increment("scheduler.inflight"); free(e); } |