forked from TrueCloudLab/frostfs-node
[#1677] writecache: Add QoS limiter usage
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
7893d763d1
commit
07a660fbc4
5 changed files with 27 additions and 1 deletions
|
@ -3,6 +3,7 @@ package writecache
|
|||
import (
|
||||
"context"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/qos"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -38,6 +39,8 @@ type options struct {
|
|||
disableBackgroundFlush bool
|
||||
// flushSizeLimit is total size of flushing objects.
|
||||
flushSizeLimit uint64
|
||||
// qosLimiter used to limit flush RPS.
|
||||
qosLimiter qos.Limiter
|
||||
}
|
||||
|
||||
// WithLogger sets logger.
|
||||
|
@ -136,3 +139,9 @@ func WithFlushSizeLimit(v uint64) Option {
|
|||
o.flushSizeLimit = v
|
||||
}
|
||||
}
|
||||
|
||||
func WithQoSLimiter(l qos.Limiter) Option {
|
||||
return func(o *options) {
|
||||
o.qosLimiter = l
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue