MCPcopy Create free account

hub / github.com/bradenaw/backpressure / functions

Functions61 in github.com/bradenaw/backpressure

↓ 17 callersMethodget
(now time.Time)
decay.go:51
↓ 16 callersMethodadd
(now time.Time, x float64)
decay.go:20
↓ 6 callersMethodAcquire
Acquire attempts to acquire some number of tokens from the semaphore on behalf of the given priority. If Acquire returns nil, these tokens should be r
semaphore.go:151
↓ 6 callersMethodWait
Wait blocks until the given number of tokens is available for the given priority. It returns nil if the tokens were successfully acquired or ErrReject
rate_limiter.go:173
↓ 4 callersMethodadmit
(now time.Time)
rate_limiter.go:301
↓ 4 callersMethodadmit
(now time.Time)
semaphore.go:289
↓ 4 callersFunctionnewWindowedCounter
(now time.Time, width time.Duration, n int)
windowed_counter.go:25
↓ 4 callersMethodrefill
(now time.Time)
rate_limiter.go:293
↓ 4 callersMethodsetMode
setMode appropriately sets the codelMode. Called internally.
codel.go:106
↓ 3 callersFunctionAcceptedError
AcceptedError wraps the given err as "accepted" by the backend for the purposes of AdaptiveThrottle. This should be done for regular protocol errors t
adaptive_throttle.go:15
↓ 3 callersFunctionWithAdaptiveThrottle
WithAdaptiveThrottle is used to send a request to a backend using the given AdaptiveThrottle for client-rejections. If f returns an error, at conside
adaptive_throttle.go:175
↓ 3 callersMethodempty
true if there are no waiters in the codel.
codel.go:36
↓ 2 callersFunctionNewAdaptiveThrottle
NewAdaptiveThrottle returns an AdaptiveThrottle. priorities is the number of priorities that the throttle will accept. Giving a priority outside of `
adaptive_throttle.go:90
↓ 2 callersFunctionNewRateLimiter
NewRateLimiter returns a rate limiter with the given number of priorities, allowing the given aggregate rate, and up to the given burst. That is, the
rate_limiter.go:124
↓ 2 callersFunctionNewSemaphore
NewSemaphore returns a semaphore with the given number of priorities, and will allow at most capacity concurrency. The other options do not frequentl
semaphore.go:101
↓ 2 callersMethodRelease
Release returns the given number of tokens to the semaphore. It should only be called if these tokens are known to be acquired from the semaphore with
semaphore.go:221
↓ 2 callersMethodcanAdmit
(now time.Time, p Priority, tokens int)
semaphore.go:282
↓ 2 callersMethodfloor
(now time.Time, floor float64)
decay.go:44
↓ 2 callersFunctionjitter
(d time.Duration)
semaphore_test.go:134
↓ 2 callersFunctionnewCodelWaiter
(now time.Time, t T)
codel.go:133
↓ 2 callersMethodpeek
returns the next item that would be removed by pop, if there is one. calling reap, setMode, or push invalidates this value.
codel.go:42
↓ 2 callersMethodpop
pop pops the next waiter from the codel. Returns zero, false if the next waiter has already been abandoned or if the queue is empty. popping the next
codel.go:62
↓ 2 callersMethodpush
push adds a waiter to the codel.
codel.go:85
↓ 2 callersMethodreap
reap removes and wakes-unsuccessfully waiters that have timed out based on the current codelMode. codel assumes this will be called at least once ever
codel.go:92
↓ 2 callersMethodsetDecayPerSec
(now time.Time, decayPerSec float64)
decay.go:31
↓ 2 callersMethodsetMax
(now time.Time, max float64)
decay.go:36
↓ 2 callersMethodwait
wait blocks until the waiter is woken up by the codel or ctx expires. returns ErrRejected if timed out by the codel.
codel.go:144
↓ 1 callersMethodAccepted
Accepted records that a request was accepted by the backend.
adaptive_throttle.go:150
↓ 1 callersFunctionAdaptiveThrottleWindow
AdaptiveThrottleWindow sets the time window over which the throttle remembers requests for use in figuring out the success rate.
adaptive_throttle.go:80
↓ 1 callersMethodAttempt
Attempt returns true if the request should be attempted, and false if it should be rejected.
adaptive_throttle.go:117
↓ 1 callersMethodClose
Close frees background resources used by the rate limiter.
rate_limiter.go:279
↓ 1 callersMethodClose
Close frees background resources used by the semaphore.
semaphore.go:269
↓ 1 callersFunctionRateLimiterDebtDecayInterval
The time it takes for 100% debt to be completely forgiven. Debt decays linearly over time since load patterns change and a previously learned debt amo
rate_limiter.go:105
↓ 1 callersFunctionRateLimiterDebtForgivePerSuccess
The proportion of debt that is forgiven for lower priorities whenever a higher-priority request succeeds, in [0, 1].
rate_limiter.go:113
↓ 1 callersFunctionRateLimiterLongTimeout
The long timeout for the internal CoDels. See the README for more on CoDel.
rate_limiter.go:97
↓ 1 callersFunctionRateLimiterShortTimeout
The short timeout for the internal CoDels. See the README for more on CoDel.
rate_limiter.go:90
↓ 1 callersMethodRejected
Rejected records that a request was rejected by the backend.
adaptive_throttle.go:159
↓ 1 callersFunctionSemaphoreDebtDecayInterval
The time it takes for 100% debt to be completely forgiven. Debt decays linearly over time since load patterns change and a previously learned debt amo
semaphore.go:83
↓ 1 callersFunctionSemaphoreDebtForgivePerSuccess
The proportion of debt that is forgiven for lower priorities whenever a higher-priority request succeeds, in [0, 1].
semaphore.go:91
↓ 1 callersFunctionSemaphoreLongTimeout
The long timeout for the internal CoDels. See the README for more on CoDel.
semaphore.go:75
↓ 1 callersFunctionSemaphoreShortTimeout
The short timeout for the internal CoDels. See the README for more on CoDel.
semaphore.go:68
↓ 1 callersMethodadmit
admit attempts to successfully-wake the waiter, returns true if the waiter will return nil from wait.
codel.go:163
↓ 1 callersMethodbackground
()
rate_limiter.go:345
↓ 1 callersMethodbackground
()
semaphore.go:250
↓ 1 callersMethoddrop
drop unsuccessfully-wakes the waiter, it will return ErrRejected from wait.
codel.go:170
↓ 1 callersMethodget
(now time.Time)
windowed_counter.go:40
FunctionAdaptiveThrottleMinimumRate
AdaptiveThrottleMinimumRate sets the minimum number of requests per second that the adaptive throttle will allow (approximately) through to the upstre
adaptive_throttle.go:72
FunctionAdaptiveThrottleRatio
AdaptiveThrottleRatio sets the ratio of the measured success rate and the rate that the throttle will admit. For example, when k is 2 the throttle wil
adaptive_throttle.go:62
MethodError
()
adaptive_throttle.go:19
MethodSetCapacity
SetCapacity sets the maximum number of outstanding tokens for the semaphore. If more tokens than this new value are already outstanding the semaphore
semaphore.go:235
MethodSetRate
(rate float64, burst float64)
rate_limiter.go:251
FunctionTestAcceptedErrorNonNilIsAccepted
(t *testing.T)
adaptive_throttle_test.go:17
FunctionTestAdaptiveThrottleBasic
(t *testing.T)
adaptive_throttle_test.go:41
FunctionTestRateLimiterStress
(t *testing.T)
rate_limiter_test.go:14
FunctionTestSemaphoreSimple
(t *testing.T)
semaphore_test.go:17
FunctionTestSemaphoreStress
(t *testing.T)
semaphore_test.go:53
FunctionTestWindowedCounter
(t *testing.T)
windowed_counter_test.go:8
FunctionTestWindowedCounterFrequent
(t *testing.T)
windowed_counter_test.go:73
MethodUnwrap
()
adaptive_throttle.go:20
Methodadd
(now time.Time, x int)
windowed_counter.go:34
FunctionnewCodel
(shortTimeout time.Duration, longTimeout time.Duration)
codel.go:26