[#9999] qos: Add Limiter

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2025-02-05 12:31:01 +03:00
parent 8023678938
commit 510fd96e0b
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0
4 changed files with 160 additions and 4 deletions

View file

@ -14,7 +14,7 @@ type tagConfig struct {
Shares, Limit, Reserved *float64
}
func ValidateConfig(c *limits.Config) error {
func validateConfig(c *limits.Config) error {
if err := validateOpConfig(c.Read()); err != nil {
return fmt.Errorf("limits 'read' section validation error: %w", err)
}
@ -90,3 +90,12 @@ func float64Value(f *float64) float64 {
}
return *f
}
func isNoop(read, write limits.OpConfig) bool {
return read.MaxRunningOps == limits.NoLimit &&
read.MaxWaitingOps == limits.NoLimit &&
write.MaxRunningOps == limits.NoLimit &&
write.MaxWaitingOps == limits.NoLimit &&
len(read.Tags) == 0 &&
len(write.Tags) == 0
}