Expand description
Rate limiting for enterprise workloads.
This module provides rate limiting capabilities for controlling request rates to GPU kernels and system resources, supporting both global and per-tenant limits.
§Features
- Token bucket and sliding window algorithms
- Per-tenant rate limiting
- Global rate limiting
- Configurable burst capacity
- Real-time statistics
§Example
ⓘ
use ringkernel_core::rate_limiting::{RateLimiter, RateLimitConfig};
let config = RateLimitConfig::default()
.with_requests_per_second(100)
.with_burst_size(50);
let limiter = RateLimiter::new(config);
if limiter.check("tenant_1").is_ok() {
// Request allowed
}Structs§
- Rate
Limit Config - Configuration for rate limiting.
- Rate
Limit Guard - RAII guard for rate-limited operations.
- Rate
Limiter - Global rate limiter.
- Rate
Limiter Builder - Builder for creating rate limiters.
- Rate
Limiter Stats Snapshot - Snapshot of rate limiter statistics.
Enums§
- Rate
Limit Algorithm - Rate limiting algorithm to use.
- Rate
Limit Error - Errors that can occur during rate limiting.
Traits§
- Rate
Limiter Ext - Extension trait for acquiring guards.
Functions§
- shared_
rate_ limiter - Create a shared rate limiter.
Type Aliases§
- Rate
Limit Result - Result type for rate limiting operations.
- Shared
Rate Limiter - Thread-safe, shareable rate limiter.