summaryrefslogtreecommitdiffstats
path: root/runtime/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-12-16 14:42:37 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-12-16 14:42:37 +0100
commit7796eeb6960b2e1d1aeac77242a5ad93a64776cc (patch)
tree1d33b1051302c48e9d87f120912689df289d76f2 /runtime/queue.c
parent01c7c9ffc6771f73df9ee0bc18e30534d6c6974c (diff)
downloadrsyslog-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.
Diffstat (limited to 'runtime/queue.c')
-rw-r--r--runtime/queue.c5
1 files changed, 5 insertions, 0 deletions
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);
}