Documentation ¶
Index ¶
- Constants
- Variables
- func NewExecutionPriorityRateLimiter(rateBurstFn quotas.RateBurst, operatorRPSRatio dynamicconfig.FloatPropertyFn) quotas.RequestRateLimiter
- func NewNamespaceReplicationInducingAPIPriorityRateLimiter(rateBurstFn quotas.RateBurst, operatorRPSRatio dynamicconfig.FloatPropertyFn) quotas.RequestRateLimiter
- func NewRequestToRateLimiter(executionRateBurstFn quotas.RateBurst, visibilityRateBurstFn quotas.RateBurst, ...) quotas.RequestRateLimiter
- func NewVisibilityPriorityRateLimiter(rateBurstFn quotas.RateBurst, operatorRPSRatio dynamicconfig.FloatPropertyFn) quotas.RequestRateLimiter
- type NamespaceRateBurstImpl
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, "PollWorkflowExecutionUpdate": 1, "QueryWorkflow": 1, "UpdateWorkflowExecution": 1, "GetWorkflowExecutionHistory": 1, "PollNexusTaskQueue": 1, } // APIToPriority determines common API priorities. // If APIs rely on visibility, they should be added to VisibilityAPIToPriority. // If APIs result in replication in namespace replication queue, they belong to NamespaceReplicationInducingAPIToPriority APIToPriority = map[string]int{ "GetClusterInfo": 0, "GetSystemInfo": 0, "GetSearchAttributes": 0, "DescribeNamespace": 0, "ListNamespaces": 0, "DeprecateNamespace": 0, "SignalWorkflowExecution": 1, "SignalWithStartWorkflowExecution": 1, "StartWorkflowExecution": 1, "UpdateWorkflowExecution": 1, "CreateSchedule": 1, "StartBatchOperation": 1, "RequestCancelWorkflowExecution": 2, "TerminateWorkflowExecution": 2, "ResetWorkflowExecution": 2, "DeleteWorkflowExecution": 2, "GetWorkflowExecutionHistory": 2, "UpdateSchedule": 2, "PatchSchedule": 2, "DeleteSchedule": 2, "StopBatchOperation": 2, "DescribeWorkflowExecution": 3, "DescribeTaskQueue": 3, "GetWorkerBuildIdCompatibility": 3, "ListTaskQueuePartitions": 3, "QueryWorkflow": 3, "DescribeSchedule": 3, "ListScheduleMatchingTimes": 3, "DescribeBatchOperation": 3, "RecordActivityTaskHeartbeat": 4, "RecordActivityTaskHeartbeatById": 4, "RespondActivityTaskCanceled": 4, "RespondActivityTaskCanceledById": 4, "RespondActivityTaskFailed": 4, "RespondActivityTaskFailedById": 4, "RespondActivityTaskCompleted": 4, "RespondActivityTaskCompletedById": 4, "RespondWorkflowTaskCompleted": 4, "RespondWorkflowTaskFailed": 4, "RespondQueryTaskCompleted": 4, "RespondNexusTaskCompleted": 4, "RespondNexusTaskFailed": 4, "PollWorkflowTaskQueue": 5, "PollActivityTaskQueue": 5, "PollWorkflowExecutionUpdate": 5, "PollNexusTaskQueue": 5, "ResetStickyTaskQueue": 5, "GetWorkflowExecutionHistoryReverse": 5, } ExecutionAPIPrioritiesOrdered = []int{0, 1, 2, 3, 4, 5} VisibilityAPIToPriority = map[string]int{ "CountWorkflowExecutions": 1, "ScanWorkflowExecutions": 1, "ListOpenWorkflowExecutions": 1, "ListClosedWorkflowExecutions": 1, "ListWorkflowExecutions": 1, "ListArchivedWorkflowExecutions": 1, "GetWorkerTaskReachability": 1, "ListSchedules": 1, "ListBatchOperations": 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} )
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 NewRequestToRateLimiter ¶
func NewRequestToRateLimiter( executionRateBurstFn quotas.RateBurst, visibilityRateBurstFn quotas.RateBurst, namespaceReplicationInducingRateBurstFn 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 NewNamespaceRateBurst ¶ added in v1.14.0
func NewNamespaceRateBurst( namespaceName string, rateFn dynamicconfig.FloatPropertyFnWithNamespaceFilter, burstFn dynamicconfig.IntPropertyFnWithNamespaceFilter, ) *NamespaceRateBurstImpl
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
Click to show internal directories.
Click to hide internal directories.