sampled

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVisibilityManager

func NewVisibilityManager(persistence persistence.VisibilityManager, p Params) persistence.VisibilityManager

NewVisibilityManager creates a client to manage visibility with sampling For write requests, it will do sampling which will lose some records For read requests, it will do sampling which will return service busy errors. Note that this is different from NewVisibilityPersistenceRateLimitedClient which is overlapping with the read processing.

Types

type Config

type Config struct {
	VisibilityOpenMaxQPS dynamicconfig.IntPropertyFnWithDomainFilter `yaml:"-" json:"-"`
	// VisibilityClosedMaxQPS max QPS for record closed workflows
	VisibilityClosedMaxQPS dynamicconfig.IntPropertyFnWithDomainFilter `yaml:"-" json:"-"`
	// VisibilityListMaxQPS max QPS for list workflow
	VisibilityListMaxQPS dynamicconfig.IntPropertyFnWithDomainFilter `yaml:"-" json:"-"`
}

Config is config for visibility

type Params

type Params struct {
	Config                 *Config
	MetricClient           metrics.Client
	Logger                 log.Logger
	TimeSource             clock.TimeSource
	RateLimiterFactoryFunc RateLimiterFactoryFunc
}

type RateLimiterFactory

type RateLimiterFactory interface {
	GetRateLimiter(domain string) tokenbucket.PriorityTokenBucket
}

func NewDomainToBucketMap

func NewDomainToBucketMap(timeSource clock.TimeSource, numOfPriority int, qpsConfig dynamicconfig.IntPropertyFnWithDomainFilter) RateLimiterFactory

NewDomainToBucketMap returns a rate limiter factory.

type RateLimiterFactoryFunc

type RateLimiterFactoryFunc func(timeSource clock.TimeSource, numOfPriority int, qpsConfig dynamicconfig.IntPropertyFnWithDomainFilter) RateLimiterFactory

Jump to

Keyboard shortcuts

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