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.
type OperatorMock ¶
func (*OperatorMock) SetControlParameters ¶
func (m *OperatorMock) SetControlParameters(value *stats.ControlParameters) error
type Option ¶ added in v0.0.2
type Option interface {
// contains filtered or unexported methods
}
Option - backpressure operator options.
func WithNotificationsOption ¶ added in v0.0.2
func WithNotificationsOption(notifications chan<- *stats.MemLimiterStats) Option
WithNotificationsOption makes it possible for a client to implement application-specific backpressure logic. Client may subscribe for the operative MemLimiter telemetry and make own decisions (taking into account metrics like RSS etc.). This is inspired by the channel that was attached to SetMaxHeap function (see https://github.com/golang/proposal/blob/master/design/48409-soft-memory-limit.md#setmaxheap)
Click to show internal directories.
Click to hide internal directories.