forked from TrueCloudLab/frostfs-node
[#1636] qos: Add Limiter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
98d6125029
commit
92a67a6716
4 changed files with 160 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue