sampled

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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