summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--plugins/impstats/impstats.c2
-rw-r--r--runtime/queue.c5
-rw-r--r--runtime/queue.h1
4 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 61210128..6f228b80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
};