qos

package
v0.46.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoLimit            int64 = math.MaxInt64
	DefaultIdleTimeout       = 5 * time.Minute
)

Variables

This section is empty.

Functions

func IOTagFromContext

func IOTagFromContext(ctx context.Context) string

func NewAdjustOutgoingIOTagStreamClientInterceptor

func NewAdjustOutgoingIOTagStreamClientInterceptor() grpc.StreamClientInterceptor

func NewAdjustOutgoingIOTagUnaryClientInterceptor

func NewAdjustOutgoingIOTagUnaryClientInterceptor() grpc.UnaryClientInterceptor

func NewMaxActiveRPCLimiterStreamServerInterceptor

func NewMaxActiveRPCLimiterStreamServerInterceptor(getLimiter func() limiting.Limiter) grpc.StreamServerInterceptor

func NewMaxActiveRPCLimiterUnaryServerInterceptor

func NewMaxActiveRPCLimiterUnaryServerInterceptor(getLimiter func() limiting.Limiter) grpc.UnaryServerInterceptor

func NewSetCriticalIOTagUnaryServerInterceptor

func NewSetCriticalIOTagUnaryServerInterceptor() grpc.UnaryServerInterceptor

Types

type IOTag

type IOTag string
const (
	IOTagBackground IOTag = "background"
	IOTagClient     IOTag = "client"
	IOTagCritical   IOTag = "critical"
	IOTagInternal   IOTag = "internal"
	IOTagPolicer    IOTag = "policer"
	IOTagTreeSync   IOTag = "treesync"
	IOTagWritecache IOTag = "writecache"
)

func FromRawString

func FromRawString(s string) (IOTag, error)

func (IOTag) IsLocal

func (t IOTag) IsLocal() bool

func (IOTag) String

func (t IOTag) String() string

type IOTagConfig

type IOTagConfig struct {
	Tag         string
	Weight      *float64
	LimitOps    *float64
	ReservedOps *float64
	Prohibited  bool
}

type Limiter

type Limiter interface {
	ReadRequest(context.Context) (ReleaseFunc, error)
	WriteRequest(context.Context) (ReleaseFunc, error)
	SetParentID(string)
	SetMetrics(Metrics)
	Close()
}

func NewLimiter

func NewLimiter(c LimiterConfig) (Limiter, error)

func NewNoopLimiter

func NewNoopLimiter() Limiter

type LimiterConfig

type LimiterConfig struct {
	Read  OpConfig
	Write OpConfig
}

func (*LimiterConfig) Validate

func (c *LimiterConfig) Validate() error

type Metrics

type Metrics interface {
	SetOperationTagCounters(shardID, operation, tag string, pending, inProgress, completed, resourceExhausted uint64)
	Close(shardID string)
}

type OpConfig

type OpConfig struct {
	MaxWaitingOps int64
	MaxRunningOps int64
	IdleTimeout   time.Duration
	Tags          []IOTagConfig
}

type ReleaseFunc

type ReleaseFunc scheduling.ReleaseFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL