backpressure

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package backpressure contains code applying control signals issued by controller to Go runtime and and to gRPC server.

Index

Constants

View Source
const (
	// DefaultGOGC - default GOGC value.
	DefaultGOGC = 100
	// NoThrottling - allow execution of all GRPC requests.
	NoThrottling = 0
	// FullThrottling - a complete ban on GRPC request execution.
	FullThrottling = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Operator

type Operator interface {
	// SetControlParameters registers the actual value of control parameters.
	SetControlParameters(value *stats.ControlParameters) error
	// AllowRequest can be used by server middleware to check if it's possible to execute
	// a particular request.
	AllowRequest() bool
	// GetStats returns statistics of Backpressure subsystem.
	GetStats() (*stats.BackpressureStats, error)
}

Operator applies control signals to Go runtime and GRPC server.

func NewOperator

func NewOperator(logger logr.Logger) Operator

NewOperator builds new Operator.

type OperatorMock

type OperatorMock struct {
	mock.Mock
}

func (*OperatorMock) AllowRequest

func (m *OperatorMock) AllowRequest() bool

func (*OperatorMock) GetStats

func (m *OperatorMock) GetStats() (*stats.BackpressureStats, error)

func (*OperatorMock) SetControlParameters

func (m *OperatorMock) SetControlParameters(value *stats.ControlParameters) error

Jump to

Keyboard shortcuts

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