summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-12-16 15:12:24 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-12-16 15:12:24 +0100
commita1b752b32ffb90bfdce4fd8dfdffac3ebbadc79e (patch)
tree0752a60ee53e04deedffc7396d7588be950b5d05 /runtime
parent7796eeb6960b2e1d1aeac77242a5ad93a64776cc (diff)
downloadrsyslog-a1b752b32ffb90bfdce4fd8dfdffac3ebbadc79e.tar.gz
rsyslog-a1b752b32ffb90bfdce4fd8dfdffac3ebbadc79e.tar.xz
rsyslog-a1b752b32ffb90bfdce4fd8dfdffac3ebbadc79e.zip
more work on queue statistics counter
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queue.c12
-rw-r--r--runtime/queue.h3
2 files changed, 10 insertions, 5 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index 1692db3a..c8e6bb27 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1355,6 +1355,7 @@ static int qqueueChkDiscardMsg(qqueue_t *pThis, int iQueueSize, void *pUsr)
if(iRetLocal == RS_RET_OK && iSeverity >= pThis->iDiscardSeverity) {
DBGOPRINT((obj_t*) pThis, "queue nearly full (%d entries), discarded severity %d message\n",
iQueueSize, iSeverity);
+ STATSCOUNTER_INC(pThis->ctrNFDscrd, pThis->mutCtrNFDscrd);
objDestruct(pUsr);
ABORT_FINALIZE(RS_RET_QUEUE_FULL);
} else {
@@ -1989,9 +1990,12 @@ 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));
+ STATSCOUNTER_INIT(pThis->ctrFDscrd, pThis->mutCtrFDscrd);
+ CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("discarded.full"),
+ ctrType_IntCtr, &pThis->ctrFDscrd));
+ STATSCOUNTER_INIT(pThis->ctrNFDscrd, pThis->mutCtrNFDscrd);
+ CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("discarded.nf"),
+ ctrType_IntCtr, &pThis->ctrNFDscrd));
pThis->ctrMaxqsize = 0;
CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("maxqsize"),
@@ -2346,7 +2350,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);
+ STATSCOUNTER_INC(pThis->ctrFDscrd, pThis->mutCtrFDscrd);
objDestruct(pUsr);
ABORT_FINALIZE(RS_RET_QUEUE_FULL);
}
diff --git a/runtime/queue.h b/runtime/queue.h
index 70bb8895..06a58229 100644
--- a/runtime/queue.h
+++ b/runtime/queue.h
@@ -169,7 +169,8 @@ struct queue_s {
statsobj_t *statsobj;
STATSCOUNTER_DEF(ctrEnqueued, mutCtrEnqueued);
STATSCOUNTER_DEF(ctrFull, mutCtrFull);
- STATSCOUNTER_DEF(ctrDscrd, mutCtrDscrd);
+ STATSCOUNTER_DEF(ctrFDscrd, mutCtrFDscrd);
+ STATSCOUNTER_DEF(ctrNFDscrd, mutCtrNFDscrd);
int ctrMaxqsize;
};