From 10dcb23ae5828c239a1d8518e90c7d6d9e2ea1a8 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 16 Oct 2013 17:44:01 +0200 Subject: bugfix: omelasticsearch: did not correctly initialize stats counters This usually did not lead to any problems, because they are in static memory, which is initialized to zero by the OS when the plugin is loaded. But it may cause problems especially on systems that do not support atomic instructions - in this case the associated mutexes also did not get properly initialized. --- plugins/omelasticsearch/omelasticsearch.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/omelasticsearch') diff --git a/plugins/omelasticsearch/omelasticsearch.c b/plugins/omelasticsearch/omelasticsearch.c index 5d4c97c3..240d19e6 100644 --- a/plugins/omelasticsearch/omelasticsearch.c +++ b/plugins/omelasticsearch/omelasticsearch.c @@ -1001,13 +1001,16 @@ CODEmodInit_QueryRegCFSLineHdlr /* support statistics gathering */ CHKiRet(statsobj.Construct(&indexStats)); CHKiRet(statsobj.SetName(indexStats, (uchar *)"omelasticsearch")); + STATSCOUNTER_INIT(indexSubmit, mutCtrIndexSubmit); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"submitted", ctrType_IntCtr, &indexSubmit)); + STATSCOUNTER_INIT(indexHTTPFail, mutCtrIndexHTTPFail); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.http", ctrType_IntCtr, &indexHTTPFail)); STATSCOUNTER_INIT(indexHTTPReqFail, mutCtrIndexHTTPReqFail); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.httprequests", ctrType_IntCtr, &indexHTTPReqFail)); + STATSCOUNTER_INIT(indexESFail, mutCtrIndexESFail); CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.es", ctrType_IntCtr, &indexESFail)); CHKiRet(statsobj.ConstructFinalize(indexStats)); -- cgit v1.2.3