From 9a2400f8b10f79bfa41511434adb8d3da65397aa Mon Sep 17 00:00:00 2001 From: Andrea Terzolo Date: Tue, 12 Jul 2022 19:23:56 +0200 Subject: [PATCH] fix(userspace): compute the `drop ratio` in the right way Signed-off-by: Andrea Terzolo Co-authored-by: Shane Lawrence --- userspace/falco/event_drops.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userspace/falco/event_drops.cpp b/userspace/falco/event_drops.cpp index 697c925ab83..b6018977c07 100644 --- a/userspace/falco/event_drops.cpp +++ b/userspace/falco/event_drops.cpp @@ -91,8 +91,8 @@ bool syscall_evt_drop_mgr::process_event(std::shared_ptr inspector, sinsp if(delta.n_drops > 0) { double ratio = delta.n_drops; - // Assuming the number of event does not contains the dropped ones - ratio /= delta.n_drops + delta.n_evts; + // The `n_evts` always contains the `n_drops`. + ratio /= delta.n_evts; // When simulating drops the threshold is always zero if(ratio > m_threshold)