mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-27 02:04:28 +01:00
rate-limiter: implement hypervisor-built-in rate limiter
As for hypervisors that support built-in rate limiter, like firecracker, we use this built-in characteristics to implement rate limiter in kata. kata-defined rate is in bits with scaling factors of 1000, otherwise fc-defined rate is in bytes with scaling factors of 1024, so need reversion. Fixes: #250 Signed-off-by: Penny Zheng <penny.zheng@arm.com>
This commit is contained in:
@@ -19,17 +19,17 @@ type TokenBucket struct {
|
||||
|
||||
// The initial size of a token bucket.
|
||||
// Minimum: 0
|
||||
OneTimeBurst *int64 `json:"one_time_burst,omitempty"`
|
||||
OneTimeBurst *uint64 `json:"one_time_burst,omitempty"`
|
||||
|
||||
// The amount of milliseconds it takes for the bucket to refill.
|
||||
// Required: true
|
||||
// Minimum: 0
|
||||
RefillTime *int64 `json:"refill_time"`
|
||||
RefillTime *uint64 `json:"refill_time"`
|
||||
|
||||
// The total number of tokens this bucket can hold.
|
||||
// Required: true
|
||||
// Minimum: 0
|
||||
Size *int64 `json:"size"`
|
||||
Size *uint64 `json:"size"`
|
||||
}
|
||||
|
||||
// Validate validates this token bucket
|
||||
|
||||
Reference in New Issue
Block a user