network

package
v0.0.0-...-9d9ea44 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const RequestBacklogQueueNoLimit = maxUint
View Source
const RequestDurationLimiterNoLimit = maxDuration

Variables

View Source
var ErrFailToProcessDueToInternalIssue = jrpc2.Error{
	Code:    -32003,
	Message: "request failed to process due to internal issue",
}
View Source
var ErrRequestExceededProcessingLimitThreshold = jrpc2.Error{
	Code:    -32001,
	Message: "request exceeded processing limit threshold",
}

Functions

func CallStack

func CallStack(recoverRes any, topLevelFunctionName string, lastCallstackMethod string, unwindStackLines int) (callStack []string)

CallStack returns an array of strings representing the current call stack. The method is tuned for the purpose of panic handler, and used as a helper in contructing the list of entries we want to write to the log / stderr / telemetry.

func MakeHTTPBacklogQueueLimiter

func MakeHTTPBacklogQueueLimiter(downstream http.Handler, gauge gauge, limit uint64, logger *log.Entry) *backlogHTTPQLimiter

func MakeHTTPRequestDurationLimiter

func MakeHTTPRequestDurationLimiter(
	downstream http.Handler,
	warningThreshold time.Duration,
	limitThreshold time.Duration,
	warningCounter increasingCounter,
	limitCounter increasingCounter,
	logger *log.Entry) *httpRequestDurationLimiter

func MakeJrpcBacklogQueueLimiter

func MakeJrpcBacklogQueueLimiter(downstream jrpc2.Handler, gauge gauge, limit uint64, logger *log.Entry) *backlogJrpcQLimiter

func MakeJrpcRequestDurationLimiter

func MakeJrpcRequestDurationLimiter(
	downstream jrpc2.Handler,
	warningThreshold time.Duration,
	limitThreshold time.Duration,
	warningCounter increasingCounter,
	limitCounter increasingCounter,
	logger *log.Entry) *rpcRequestDurationLimiter

Types

This section is empty.

Jump to

Keyboard shortcuts

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