diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-12-19 17:30:43 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-12-19 17:30:43 +0100 |
commit | 00d2ac3d712fb037411e9856e8174e9d55b5bdbc (patch) | |
tree | 9d439fc87eeef077bda652e9ce332182c139fc60 /plugins/imudp/imudp.c | |
parent | b80b0672beb9b8b4d07791791bb9f2fb7c73889a (diff) | |
parent | 55db71963e312634f78c25b61dd4800036fe25f9 (diff) | |
download | rsyslog-00d2ac3d712fb037411e9856e8174e9d55b5bdbc.tar.gz rsyslog-00d2ac3d712fb037411e9856e8174e9d55b5bdbc.tar.xz rsyslog-00d2ac3d712fb037411e9856e8174e9d55b5bdbc.zip |
Merge branch 'v5-devel'
Conflicts:
ChangeLog
action.c
plugins/imudp/imudp.c
Diffstat (limited to 'plugins/imudp/imudp.c')
-rw-r--r-- | plugins/imudp/imudp.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index 31f5cce9..badad949 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -51,6 +51,7 @@ #include "datetime.h" #include "prop.h" #include "ruleset.h" +#include "statsobj.h" #include "unicode-helper.h" MODULE_TYPE_INPUT @@ -67,6 +68,10 @@ DEFobjCurrIf(net) DEFobjCurrIf(datetime) DEFobjCurrIf(prop) DEFobjCurrIf(ruleset) +DEFobjCurrIf(statsobj) + +statsobj_t *modStats; +STATSCOUNTER_DEF(ctrSubmit, mutCtrSubmit) static int bDoACLCheck; /* are ACL checks neeed? Cached once immediately before listener startup */ static int iMaxLine; /* maximum UDP message size supported */ @@ -333,6 +338,7 @@ processSocket(thrdInfo_t *pThrd, int fd, struct sockaddr_storage *frominetPrev, pMsg->msgFlags |= NEEDS_ACLCHK_U; /* request ACL check after resolution */ CHKiRet(msgSetFromSockinfo(pMsg, &frominet)); CHKiRet(submitMsg(pMsg)); + STATSCOUNTER_INC(ctrSubmit, mutCtrSubmit); } } @@ -735,9 +741,12 @@ CODESTARTmodExit if(pInputName != NULL) prop.Destruct(&pInputName); + statsobj.Destruct(&modStats); + /* release what we no longer need */ objRelease(errmsg, CORE_COMPONENT); objRelease(glbl, CORE_COMPONENT); + objRelease(statsobj, CORE_COMPONENT); objRelease(datetime, CORE_COMPONENT); objRelease(prop, CORE_COMPONENT); objRelease(ruleset, CORE_COMPONENT); @@ -786,6 +795,7 @@ CODESTARTmodInit CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(glbl, CORE_COMPONENT)); + CHKiRet(objUse(statsobj, CORE_COMPONENT)); CHKiRet(objUse(datetime, CORE_COMPONENT)); CHKiRet(objUse(prop, CORE_COMPONENT)); CHKiRet(objUse(ruleset, CORE_COMPONENT)); @@ -811,6 +821,13 @@ CODEmodInit_QueryRegCFSLineHdlr NULL, &cs.iTimeRequery, STD_LOADABLE_MODULE_ID, eConfObjGlobal)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID, eConfObjGlobal)); + + /* support statistics gathering */ + CHKiRet(statsobj.Construct(&modStats)); + CHKiRet(statsobj.SetName(modStats, UCHAR_CONSTANT("imudp"))); + CHKiRet(statsobj.AddCounter(modStats, UCHAR_CONSTANT("submitted"), + ctrType_IntCtr, &ctrSubmit)); + CHKiRet(statsobj.ConstructFinalize(modStats)); ENDmodInit /* vim:set ai: */ |