flow/worker: don't double count flow.wrk.flows_evicted

Since the queue isn't fully processed every run, double counting
could happen.

Fix by only counting actually processed flows from the queue.
pull/8945/head
Victor Julien 2 years ago
parent 73e665f42a
commit afbd4162f2

@ -223,6 +223,8 @@ static void CheckWorkQueue(ThreadVars *tv, FlowWorkerThreadData *fw, FlowTimeout
if (ret_queue.len > 0) {
FlowSparePoolReturnFlows(&ret_queue);
}
StatsAddUI64(tv, fw->cnt.flows_removed, (uint64_t)i);
}
/** \brief handle flow for packet
@ -500,8 +502,6 @@ static inline void FlowWorkerProcessLocalFlows(ThreadVars *tv, FlowWorkerThreadD
FLOWWORKER_PROFILING_START(p, PROFILE_FLOWWORKER_FLOW_EVICTED);
if (fw->fls.work_queue.len) {
StatsAddUI64(tv, fw->cnt.flows_removed, (uint64_t)fw->fls.work_queue.len);
FlowTimeoutCounters counters = { 0, 0, };
CheckWorkQueue(tv, fw, &counters, &fw->fls.work_queue, max_work);
UpdateCounters(tv, fw, &counters);

Loading…
Cancel
Save