load

package
v1.0.50 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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