load

package
v1.1.5-0...-dfb45c8 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServiceOverloaded = errors.New("service overloaded")
)

Functions

func Disable

func Disable()

Types

type Promise

type Promise interface {
	Pass()
	Fail()
}

type Shedder

type Shedder interface {
	Allow() (Promise, error)
}

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()

Jump to

Keyboard shortcuts

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