Documentation
¶
Index ¶
- type Cfg
- type FixedRateLimiter
- func (frl *FixedRateLimiter) Init() error
- func (frl *FixedRateLimiter) RxWaitN(ctx context.Context, n int, timeout time.Duration) error
- func (frl *FixedRateLimiter) SetRxLimit(n int, burst int)
- func (frl *FixedRateLimiter) SetTxLimit(n int, burst int)
- func (frl *FixedRateLimiter) TxWaitN(ctx context.Context, n int, timeout time.Duration) error
- type FixedRateLimiterCfg
- type HostRateLimiter
- type HostRateLimiterCfg
- type RxTxRateLimiter
- type SleepRateLimiter
- type SleepRateLimiterCfg
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cfg ¶ added in v0.11.0
func (*Cfg) UnmarshalJSON ¶ added in v0.11.0
func (*Cfg) UnmarshalYAML ¶ added in v0.11.0
type FixedRateLimiter ¶
type FixedRateLimiter struct {
runner.Runner
*FixedRateLimiterCfg
// contains filtered or unexported fields
}
func NewFixedRateLimiter ¶
func NewFixedRateLimiter() *FixedRateLimiter
func (*FixedRateLimiter) Init ¶
func (frl *FixedRateLimiter) Init() error
func (*FixedRateLimiter) SetRxLimit ¶ added in v0.11.37
func (frl *FixedRateLimiter) SetRxLimit(n int, burst int)
func (*FixedRateLimiter) SetTxLimit ¶ added in v0.11.37
func (frl *FixedRateLimiter) SetTxLimit(n int, burst int)
type FixedRateLimiterCfg ¶
func NewFixedRateLimiterCfg ¶
func NewFixedRateLimiterCfg() *FixedRateLimiterCfg
type HostRateLimiter ¶
type HostRateLimiter struct {
runner.Runner
*HostRateLimiterCfg
// contains filtered or unexported fields
}
func NewHostRateLimiter ¶
func NewHostRateLimiter() *HostRateLimiter
func (*HostRateLimiter) Init ¶
func (h *HostRateLimiter) Init() error
func (*HostRateLimiter) NicSpeedMBps ¶ added in v0.11.52
func (h *HostRateLimiter) NicSpeedMBps() int
type HostRateLimiterCfg ¶
type HostRateLimiterCfg struct {
Nic string `json:"nic" yaml:"nic" validate:"required"`
MonitorInterval int `json:"monitorInterval" yaml:"monitorInterval" validate:"required"`
MaxPercent int `json:"maxPercent" yaml:"maxPercent" validate:"gte=0,lte=100"`
MaxMBps int `json:"maxMBps" yaml:"maxMBps"`
MinMBps int `json:"minMBps" yaml:"minMBps" validate:"gte=0"`
}
func NewHostRateLimiterCfg ¶
func NewHostRateLimiterCfg() *HostRateLimiterCfg
type RxTxRateLimiter ¶
type SleepRateLimiter ¶
type SleepRateLimiter struct {
runner.Runner
*SleepRateLimiterCfg
}
func NewSleepRateLimiter ¶
func NewSleepRateLimiter() *SleepRateLimiter
func (*SleepRateLimiter) Init ¶
func (srl *SleepRateLimiter) Init() error
type SleepRateLimiterCfg ¶
type SleepRateLimiterCfg struct {
Microsecond int
}
func NewSleepRateLimiterCfg ¶
func NewSleepRateLimiterCfg() *SleepRateLimiterCfg
Click to show internal directories.
Click to hide internal directories.