Cherry-pick to 7.x: Rate limit processor (#22883)#23095
Merged
ycombinator merged 1 commit intoelastic:7.xfrom Dec 14, 2020
ycombinator:backport/7.x/pr-22883
Merged
Cherry-pick to 7.x: Rate limit processor (#22883)#23095ycombinator merged 1 commit intoelastic:7.xfrom ycombinator:backport/7.x/pr-22883
ycombinator merged 1 commit intoelastic:7.xfrom
ycombinator:backport/7.x/pr-22883
Conversation
* Implement basic scaffolding for rate_limit processor * Fixing import cycle * Adding skeleton for token bucket algo * Set default algorithm in default config * Using an algo constructor * Implement token bucket rate limiting algorithm * Resolving some TODOs * Adding license header * Removing old TODO comment * Adding tests * Reverting to previous logic * Adding CHANGELOG entry * Adding TODOs for more tests * Fixing comment * Fixing error messages * Fixing comment * Fleshing out godoc comments * Fixing logger location * Fixing up docs a bit * Adding test for "fields" config * WIP: adding test for burst multiplier * Return pointer to bucket from getBucket * Keep pointers to buckets in map to avoid map reassignment * Fix test * Fix logic as we cannot allow withdrawal of fractional (<1) tokens * Move burst multiplier default to token_bucket algo * Implementing GC * Making the factory take the algo config and return the algo * Reduce nesting level * Use mitchellh/hashstructure * Using sync.Map * Removing algorithm and algorithm options from documentation * Mocking clock * Adding license headers * Using atomic.Uints for metrics counters * Fixing logic * Use github.com/jonboulle/clockwork * Running make update * Add mutex to prevent only one GC thread from running at any time * Adding logging * Remove NumBuckets GC threshold * Use non-blocking mutex * Perform actual GC in own goroutine * Running mage fmt * Fixing processor name * Importing rate limit processor * Initialize mutex * Do not register as a JS processor * Remove unused field * Mark processor as beta * Renaming package * Flatenning package hierarchy * Remove SetClock from algorithm interface # Conflicts: # go.mod # go.sum
Contributor
|
Pinging @elastic/integrations-platforms (Team:Platforms) |
Contributor
💔 Build Failed
Expand to view the summary
Build stats
Test stats 🧪
Steps errors
Expand to view the steps failures
|
| Test | Results |
|---|---|
| Failed | 0 |
| Passed | 17385 |
| Skipped | 1404 |
| Total | 18789 |
jsoriano
approved these changes
Dec 13, 2020
Contributor
Author
|
Similar to the original PR for this backport, #22883, this PR's CI build is failing on an unrelated packaging job. Merging... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports the following commits to 7.x: