Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(userspace): compute the drop ratio in the right way #2128

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions userspace/falco/event_drops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ bool syscall_evt_drop_mgr::process_event(std::shared_ptr<sinsp> 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)
Expand Down