Commit Graph

6 Commits

Author SHA1 Message Date
Madhav Jivrajani
b9fa896d5d Refactor client-go/util/flowcontrol/throttle.go RateLimiter
- Introduce PassiveRateLimiter which implements all methods of previous RateLimiter except Accept() and Wait()
- Change RateLimiter interface to extend PassiveRateLimiter by additionally implementing Accept() and Wait()
- Make client-go/tools/record use PassiveRateLimiter

Refactor EventSourceObjectSpamFilter, EventAggregator, EventCorrelator

- EventSourceObjectSpamFilter, EventAggregator, EventCorrelator use clock.PassiveClock now.
	- This won't be a breaking change because even if a clock.Clock is passed, it still implements the clock.PassiveClock interface.
- Extend clock.PassiveClock through Clock.
- Replace pacakge local implementation of realClock with clock.RealClock
- In flowcontrol/throttle.go split tokenBucketRateLimiters to use Clock and clock.PassiveClock.
- Migrate client-go/tools/record tests from using IntervalClock to using SimpleIntervalClock (honest implementation of clock.PassiveClock)

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: ac5c55f0bd853fcf883d9b8e1f5ef728a2fb5309
2021-08-25 21:56:26 +05:30
chenjun.cj
8f99f83432 flowcontrol context aware and fix request may hang issue
Kubernetes-commit: ce8805f95fcf6540397eaa60b8d84db752f05eea
2019-06-21 12:17:46 +08:00
Jordan Liggitt
acc52496ce Switch from juju/ratelimit to golang.org/x/time/rate
Kubernetes-commit: 4b9f00988b9401f6c774d3d5e1bce45a8e8f81c8
2018-01-19 02:08:51 -05:00
Jordan Liggitt
7392f7f78f Remove Saturation() from rate limiter interface
Kubernetes-commit: a9ed90f227f07fab2da75541d57a5366ddb38f66
2018-01-19 01:59:33 -05:00
Tim Hockin
7bef0aa41b Inject clock through flowcontrol
Kubernetes-commit: 3153ca2815c5a596adec770392248573c7e448b7
2017-06-13 20:38:45 +00:00
Kubernetes Publisher
fcdf37233b published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is baaaf26609565b4299008018486ec75fb30903eb
2017-01-25 15:19:43 +00:00