summaryrefslogtreecommitdiffstats
path: root/runtime/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-03-12 16:12:40 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-03-12 16:12:40 +0100
commit74e09afd6db56f6e23c965f0949cfb9979928f13 (patch)
tree474696cdc9936c58916d96e5e3d01d38c851ef79 /runtime/queue.c
parent50a94aa1c72ba8aab5443ecc04b51190da0df513 (diff)
parent16cc84fc699fc3f830b0c28d677d6ae0daa35723 (diff)
downloadrsyslog-74e09afd6db56f6e23c965f0949cfb9979928f13.tar.gz
rsyslog-74e09afd6db56f6e23c965f0949cfb9979928f13.tar.xz
rsyslog-74e09afd6db56f6e23c965f0949cfb9979928f13.zip
Merge branch 'v5-stable' into v5-stable-newstats
Diffstat (limited to 'runtime/queue.c')
-rw-r--r--runtime/queue.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index 523ae0fc..d1ac96fa 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1788,7 +1788,8 @@ qqueueChkStopWrkrDA(qqueue_t *pThis)
{
DEFiRet;
-//DBGPRINTF("XXXX: chkStopWrkrDA called, low watermark %d, phys Size %d\n", pThis->iLowWtrMrk, getPhysicalQueueSize(pThis));
+ /*DBGPRINTF("XXXX: chkStopWrkrDA called, low watermark %d, log Size %d, phys Size %d, bEnqOnly %d\n",
+ pThis->iLowWtrMrk, getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis), pThis->bEnqOnly);*/
if(pThis->bEnqOnly) {
iRet = RS_RET_TERMINATE_WHEN_IDLE;
}
@@ -1809,6 +1810,8 @@ static rsRetVal
ChkStopWrkrReg(qqueue_t *pThis)
{
DEFiRet;
+ /*DBGPRINTF("XXXX: chkStopWrkrReg called, low watermark %d, log Size %d, phys Size %d, bEnqOnly %d\n",
+ pThis->iLowWtrMrk, getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis), pThis->bEnqOnly);*/
if(pThis->bEnqOnly) {
iRet = RS_RET_TERMINATE_NOW;
} else if(pThis->pqParent != NULL) {
@@ -1845,6 +1848,7 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
int wrk;
uchar *qName;
size_t lenBuf;
+ int iQueueSizeSave;
ASSERT(pThis != NULL);
@@ -1926,8 +1930,11 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
qName = obj.GetName((obj_t*)pThis);
CHKiRet(statsobj.Construct(&pThis->statsobj));
CHKiRet(statsobj.SetName(pThis->statsobj, qName));
+ /* we need to save the queue size, as the stats module initializes it to 0! */
+ iQueueSizeSave = pThis->iQueueSize;
CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("size"),
ctrType_Int, &pThis->iQueueSize));
+ pThis->iQueueSize = iQueueSizeSave;
STATSCOUNTER_INIT(pThis->ctrEnqueued, pThis->mutCtrEnqueued);
CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("enqueued"),