configs

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OperatorPriority is used to give precedence to calls coming from web UI or tctl
	OperatorPriority = 0
)

Variables

View Source
var (
	// ExecutionAPICountLimitOverride determines how many tokens each of these API calls consumes from their
	// corresponding quota, which is determined by dynamicconfig.FrontendMaxConcurrentLongRunningRequestsPerInstance. If
	// the value is not set, then the method is not considered a long-running request and the number of concurrent
	// requests will not be throttled. The Poll* methods here are long-running because they block until there is a task
	// available. The GetWorkflowExecutionHistory method is blocking only if WaitNewEvent is true, otherwise it is not
	// long-running. The QueryWorkflow and UpdateWorkflowExecution methods are long-running because they both block
	// until a background WFT is complete.
	ExecutionAPICountLimitOverride = map[string]int{
		"PollActivityTaskQueue":       1,
		"PollWorkflowTaskQueue":       1,
		"QueryWorkflow":               1,
		"UpdateWorkflowExecution":     1,
		"GetWorkflowExecutionHistory": 1,
	}

	ExecutionAPIToPriority = map[string]int{

		"StartWorkflowExecution":           1,
		"SignalWithStartWorkflowExecution": 1,
		"SignalWorkflowExecution":          1,
		"RequestCancelWorkflowExecution":   1,
		"TerminateWorkflowExecution":       1,
		"GetWorkflowExecutionHistory":      1,
		"UpdateWorkflowExecution":          1,

		"RecordActivityTaskHeartbeat":      2,
		"RecordActivityTaskHeartbeatById":  2,
		"RespondActivityTaskCanceled":      2,
		"RespondActivityTaskCanceledById":  2,
		"RespondActivityTaskFailed":        2,
		"RespondActivityTaskFailedById":    2,
		"RespondActivityTaskCompleted":     2,
		"RespondActivityTaskCompletedById": 2,
		"RespondWorkflowTaskCompleted":     2,
		"RespondWorkflowTaskFailed":        2,
		"RespondQueryTaskCompleted":        2,

		"ResetWorkflowExecution":             3,
		"DescribeWorkflowExecution":          3,
		"QueryWorkflow":                      3,
		"PollWorkflowTaskQueue":              3,
		"PollActivityTaskQueue":              3,
		"PollWorkflowExecutionUpdate":        3,
		"GetWorkflowExecutionHistoryReverse": 3,
		"GetWorkerBuildIdCompatibility":      3,
		"GetWorkerTaskReachability":          3,
		"DeleteWorkflowExecution":            3,

		"ResetStickyTaskQueue":    4,
		"DescribeTaskQueue":       4,
		"ListTaskQueuePartitions": 4,
	}

	ExecutionAPIPrioritiesOrdered = []int{0, 1, 2, 3, 4}

	VisibilityAPIToPriority = map[string]int{
		"CountWorkflowExecutions":        1,
		"ScanWorkflowExecutions":         1,
		"ListOpenWorkflowExecutions":     1,
		"ListClosedWorkflowExecutions":   1,
		"ListWorkflowExecutions":         1,
		"ListArchivedWorkflowExecutions": 1,
	}

	VisibilityAPIPrioritiesOrdered = []int{0, 1}

	// Special rate limiting for APIs that may insert replication tasks into a namespace replication queue.
	// The replication queue is used to propagate critical failover messages and this mapping prevents flooding the
	// queue and delaying failover.
	NamespaceReplicationInducingAPIToPriority = map[string]int{
		"RegisterNamespace":                1,
		"UpdateNamespace":                  1,
		"UpdateWorkerBuildIdCompatibility": 2,
	}

	NamespaceReplicationInducingAPIPrioritiesOrdered = []int{0, 1, 2}

	OtherAPIToPriority = map[string]int{
		"GetClusterInfo":      1,
		"GetSystemInfo":       1,
		"GetSearchAttributes": 1,

		"DescribeNamespace":  1,
		"ListNamespaces":     1,
		"DeprecateNamespace": 1,

		"CreateSchedule":            1,
		"DescribeSchedule":          1,
		"UpdateSchedule":            1,
		"PatchSchedule":             1,
		"ListScheduleMatchingTimes": 1,
		"DeleteSchedule":            1,
		"ListSchedules":             1,

		"DescribeBatchOperation": 1,
		"ListBatchOperations":    1,
		"StartBatchOperation":    1,
		"StopBatchOperation":     1,
	}

	OtherAPIPrioritiesOrdered = []int{0, 1}
)

Functions

func NewExecutionPriorityRateLimiter

func NewExecutionPriorityRateLimiter(
	rateBurstFn quotas.RateBurst,
	operatorRPSRatio dynamicconfig.FloatPropertyFn,
) quotas.RequestRateLimiter

func NewNamespaceReplicationInducingAPIPriorityRateLimiter added in v1.21.0

func NewNamespaceReplicationInducingAPIPriorityRateLimiter(
	rateBurstFn quotas.RateBurst,
	operatorRPSRatio dynamicconfig.FloatPropertyFn,
) quotas.RequestRateLimiter

func NewOtherAPIPriorityRateLimiter

func NewOtherAPIPriorityRateLimiter(
	rateBurstFn quotas.RateBurst,
	operatorRPSRatio dynamicconfig.FloatPropertyFn,
) quotas.RequestRateLimiter

func NewRequestToRateLimiter

func NewRequestToRateLimiter(
	executionRateBurstFn quotas.RateBurst,
	visibilityRateBurstFn quotas.RateBurst,
	namespaceReplicationInducingRateBurstFn quotas.RateBurst,
	otherRateBurstFn quotas.RateBurst,
	operatorRPSRatio dynamicconfig.FloatPropertyFn,
) quotas.RequestRateLimiter

func NewVisibilityPriorityRateLimiter

func NewVisibilityPriorityRateLimiter(
	rateBurstFn quotas.RateBurst,
	operatorRPSRatio dynamicconfig.FloatPropertyFn,
) quotas.RequestRateLimiter

Types

type NamespaceRateBurstImpl added in v1.14.4

type NamespaceRateBurstImpl struct {
	// contains filtered or unexported fields
}

func (*NamespaceRateBurstImpl) Burst added in v1.14.4

func (c *NamespaceRateBurstImpl) Burst() int

func (*NamespaceRateBurstImpl) Rate added in v1.14.4

func (c *NamespaceRateBurstImpl) Rate() float64

Jump to

Keyboard shortcuts

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