-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* 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
- Loading branch information
1 parent
800e0e0
commit 73ec647
Showing
12 changed files
with
972 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.