diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-12-16 14:42:37 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-12-16 14:42:37 +0100 |
commit | 7796eeb6960b2e1d1aeac77242a5ad93a64776cc (patch) | |
tree | 1d33b1051302c48e9d87f120912689df289d76f2 | |
parent | 01c7c9ffc6771f73df9ee0bc18e30534d6c6974c (diff) | |
download | rsyslog-7796eeb6960b2e1d1aeac77242a5ad93a64776cc.tar.gz rsyslog-7796eeb6960b2e1d1aeac77242a5ad93a64776cc.tar.bz2 rsyslog-7796eeb6960b2e1d1aeac77242a5ad93a64776cc.zip |
new stats counter "discarded" for queue object
Tells how many messages have been discarded due to queue full condition.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | plugins/impstats/impstats.c | 2 | ||||
-rw-r--r-- | runtime/queue.c | 5 | ||||
-rw-r--r-- | runtime/queue.h | 1 |
4 files changed, 11 insertions, 1 deletions
@@ -1,5 +1,9 @@ --------------------------------------------------------------------------- Version 5.9.5 [V5-DEVEL], 2011-11-29 +- new stats counter "discarded" for queue object. Tells how many messages + have been discarded due to queue full condition. +--------------------------------------------------------------------------- +Version 5.9.5 [V5-DEVEL], 2011-11-29 - enhanced module loader to not rely on PATH_MAX --------------------------------------------------------------------------- Version 5.9.4 [V5-DEVEL], 2011-11-29 diff --git a/plugins/impstats/impstats.c b/plugins/impstats/impstats.c index cfbbad76..dc2541b8 100644 --- a/plugins/impstats/impstats.c +++ b/plugins/impstats/impstats.c @@ -10,7 +10,7 @@ * of the "old" message code without any modifications. However, it * helps to have things at the right place one we go to the meat of it. * - * Copyright 2010 Rainer Gerhards and Adiscon GmbH. + * Copyright 2010-2011 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * diff --git a/runtime/queue.c b/runtime/queue.c index d81c552b..1692db3a 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -1989,6 +1989,10 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */ CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("full"), ctrType_IntCtr, &pThis->ctrFull)); + STATSCOUNTER_INIT(pThis->ctrDscrd, pThis->mutCtrDscrd); + CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("discarded"), + ctrType_IntCtr, &pThis->ctrDscrd)); + pThis->ctrMaxqsize = 0; CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("maxqsize"), ctrType_Int, &pThis->ctrMaxqsize)); @@ -2342,6 +2346,7 @@ doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr) // TODO : handle enqOnly => discard! if(pthread_cond_timedwait(&pThis->notFull, pThis->mut, &t) != 0) { DBGOPRINT((obj_t*) pThis, "enqueueMsg: cond timeout, dropping message!\n"); + STATSCOUNTER_INC(pThis->ctrDscrd, pThis->mutCtrDscrd); objDestruct(pUsr); ABORT_FINALIZE(RS_RET_QUEUE_FULL); } diff --git a/runtime/queue.h b/runtime/queue.h index 97057180..70bb8895 100644 --- a/runtime/queue.h +++ b/runtime/queue.h @@ -169,6 +169,7 @@ struct queue_s { statsobj_t *statsobj; STATSCOUNTER_DEF(ctrEnqueued, mutCtrEnqueued); STATSCOUNTER_DEF(ctrFull, mutCtrFull); + STATSCOUNTER_DEF(ctrDscrd, mutCtrDscrd); int ctrMaxqsize; }; |