MCPcopy Create free account
hub / github.com/facebook/CacheLib / throttle

Method throttle

cachelib/allocator/MemoryMonitor.cpp:342–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342size_t RateLimiter::throttle(int64_t delta) {
343 if (rateOfChange_ < 0 || windowSize_ < 2) {
344 return delta; // No throttling
345 }
346 // Fully throttled when we either have insufficient number of samples or
347 // rate of change is faster than proposed delta change.
348 if (values_.size() < windowSize_ || delta < rateOfChange_) {
349 return 0;
350 }
351 // Throttle down delta by rate of change. The greater the rate of change, the
352 // more the delta is throttled.
353 return delta - rateOfChange_;
354}
355
356} // namespace facebook::cachelib

Callers 10

throttleWithMethod · 0.45
ChainedHashTable.hFile · 0.45
resetMethod · 0.45
resetMethod · 0.45
reapSlabWalkModeMethod · 0.45
reclaimSlabsMethod · 0.45
waitUntilAllFreedMethod · 0.45
TESTFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by 1

TESTFunction · 0.36