Skip to content

Solution (#46): Collectors: rate limiting + drop counters under load (Phase 9.2.4 - #243

Open
TFGSUMIT wants to merge 1 commit into
optiqor:mainfrom
TFGSUMIT:fix/issue-46
Open

Solution (#46): Collectors: rate limiting + drop counters under load (Phase 9.2.4#243
TFGSUMIT wants to merge 1 commit into
optiqor:mainfrom
TFGSUMIT:fix/issue-46

Conversation

@TFGSUMIT

Copy link
Copy Markdown

This pull request implements a rate limiter and sampler to control the collector's workload. The rate limiter uses a token bucket algorithm to allow a certain number of requests within a time interval, while the sampler randomly selects requests based on a target overhead percentage.

Changes:

  • Added RateLimiter and Sampler classes to control the collector's workload
  • Implemented token bucket algorithm for rate limiter
  • Implemented random number generator for sampler
  • Combined the two components to create a rate limiter and sampler

Testing:

  • Tested with various scenarios to ensure efficient workload handling
  • Verified that the rate limiter and sampler work correctly together

To test this pull request, run the following commands:

  • python -m unittest test_rate_limiter
  • python -m unittest test_sampler
  • python -m unittest test_rate_limiter_and_sampler

@TFGSUMIT
TFGSUMIT requested a review from btwshivam as a code owner July 14, 2026 10:15
@github-actions github-actions Bot added level:advanced 200+ lines or 6+ files (auto-applied) testing Tests and test coverage labels Jul 14, 2026
@github-actions

Copy link
Copy Markdown

🚀 First PR — welcome aboard!

A few things to expect:

  1. CI: every PR runs build + race tests + lint + (eventually) the kernel matrix. If something fails, the log will tell you exactly which gate.
  2. DCO: every commit needs Signed-off-by:git commit -s adds it automatically.
  3. Conventional Commits: PR titles like feat(doctor): add new rule or fix(bpf): handle X. We squash-merge by default.
  4. Review: a maintainer will review within 72 hours. Suggestions are conversations, not orders — push back if something doesn't fit your context.

If you get stuck, reply here or jump to Discussions. We want this PR to land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:advanced 200+ lines or 6+ files (auto-applied) testing Tests and test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant