summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-12-19 14:16:32 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-12-19 14:19:37 +0100
commit32203be41af9c682a4f81c629f08b0593d755f69 (patch)
tree0a098604fc795be32864d9880e9c72256c4bc7b1 /action.c
parent58d1c9e21b2c31a1f1f6631275a6f90886321269 (diff)
downloadrsyslog-32203be41af9c682a4f81c629f08b0593d755f69.tar.gz
rsyslog-32203be41af9c682a4f81c629f08b0593d755f69.tar.xz
rsyslog-32203be41af9c682a4f81c629f08b0593d755f69.zip
better performance for action stats & cleanup: removing debug prints
Diffstat (limited to 'action.c')
-rw-r--r--action.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/action.c b/action.c
index 66d7b55c..7226e7d6 100644
--- a/action.c
+++ b/action.c
@@ -1617,14 +1617,16 @@ doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch)
pBatch->pElem[i].bFilterOK = 0;
bModifiedFilter = 1;
}
- if(pBatch->pElem[i].bFilterOK)
+ if(pBatch->pElem[i].bFilterOK) {
+ STATSCOUNTER_INC(pAction->ctrProcessed, pAction->mutCtrProcessed);
bNeedSubmit = 1;
+ }
DBGPRINTF("action %p[%d]: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n",
pAction, i, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state,
pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended);
}
if(bNeedSubmit) {
- countStatsBatchEnq(pAction, pBatch);
+ /* note: stats were already computed above */
iRet = qqueueEnqObjDirectBatch(pAction->pQueue, pBatch);
} else {
DBGPRINTF("no need to submit batch, all bFilterOK==0\n");
@@ -1639,7 +1641,8 @@ doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch)
}
}
} else {
- countStatsBatchEnq(pAction, pBatch);
+ if(GatherStats)
+ countStatsBatchEnq(pAction, pBatch);
iRet = qqueueEnqObjDirectBatch(pAction->pQueue, pBatch);
}