Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrServiceOverloaded = errors.New("service overloaded")
)
Functions ¶
Types ¶
type Shedder ¶
func NewAdaptiveShedder ¶
func NewAdaptiveShedder(opts ...ShedderOption) Shedder
type ShedderGroup ¶
type ShedderGroup struct {
// contains filtered or unexported fields
}
func NewShedderGroup ¶
func NewShedderGroup(opts ...ShedderOption) *ShedderGroup
func (*ShedderGroup) GetShedder ¶
func (g *ShedderGroup) GetShedder(key string) Shedder
type ShedderOption ¶
type ShedderOption func(opts *shedderOptions)
func WithBuckets ¶
func WithBuckets(buckets int) ShedderOption
func WithCpuThreshold ¶
func WithCpuThreshold(threshold int64) ShedderOption
func WithWindow ¶
func WithWindow(window time.Duration) ShedderOption
type SheddingStat ¶
type SheddingStat struct {
// contains filtered or unexported fields
}
func NewSheddingStat ¶
func NewSheddingStat(name string) *SheddingStat
func (*SheddingStat) IncrementDrop ¶
func (s *SheddingStat) IncrementDrop()
func (*SheddingStat) IncrementPass ¶
func (s *SheddingStat) IncrementPass()
func (*SheddingStat) IncrementTotal ¶
func (s *SheddingStat) IncrementTotal()
Click to show internal directories.
Click to hide internal directories.