MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / reset

Method reset

rate_limiter/src/lib.rs:531–534  ·  view source on GitHub ↗

Resets the token bucket: budget set to max capacity and last-updated set to now.

(&mut self)

Source from the content-addressed store, hash-verified

529 impl TokenBucket {
530 // Resets the token bucket: budget set to max capacity and last-updated set to now.
531 fn reset(&mut self) {
532 self.budget = self.size;
533 self.last_update = Instant::now();
534 }
535
536 fn get_last_update(&self) -> &Instant {
537 &self.last_update

Callers 2

activate_timerMethod · 0.45
test_token_bucket_reduceFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_token_bucket_reduceFunction · 0.36