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

🐛 Keep rule total in output logging #435

Merged
merged 1 commit into from
Nov 20, 2023
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: 1 addition & 3 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ func (r *ruleEngine) RunRules(ctx context.Context, ruleSets []RuleSet, selectors
// Need a better name for this thing
ret := make(chan response)

var totalRules int32
var matchedRules int32
var unmatchedRules int32
var failedRules int32
Expand Down Expand Up @@ -195,8 +194,7 @@ func (r *ruleEngine) RunRules(ctx context.Context, ruleSets []RuleSet, selectors
rs.Unmatched = append(rs.Unmatched, response.Rule.RuleID)
}
}
atomic.AddInt32(&totalRules, 1)
r.logger.V(5).Info("rule response received", "total", totalRules, "failed", failedRules, "matched", matchedRules, "unmatched", unmatchedRules)
r.logger.V(5).Info("rule response received", "total", len(otherRules), "failed", failedRules, "matched", matchedRules, "unmatched", unmatchedRules)

}()
case <-ctx.Done():
Expand Down
Loading