persister

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAutoOpsRuleNotFound    = errors.New("eventpersister: auto ops rule not found")
	ErrFeatureEmptyList       = errors.New("eventpersister: list feature returned empty")
	ErrFeatureVersionNotFound = errors.New("eventpersister: feature version not found")
	ErrNoExperiments          = errors.New("eventpersister: no experiments")
	ErrNothingToLink          = errors.New("eventpersister: nothing to link")
	ErrUnexpectedMessageType  = errors.New("eventpersister: unexpected message type")
)

Functions

func NewPersister

func NewPersister(
	updater Updater,
	mysqlClient mysql.Client,
	client *pubsub.Client,
	subscription string,
	topic string,
	pullerNumGoroutines int,
	pullerMaxOutstandingMessages int,
	pullerMaxOutstandingBytes int,
	opts ...Option,
) *persister

Types

type Option

type Option func(*options)

func WithCheckInterval added in v0.4.0

func WithCheckInterval(interval time.Duration) Option

func WithFlushInterval

func WithFlushInterval(i time.Duration) Option

func WithFlushSize

func WithFlushSize(s int) Option

func WithFlushTimeout

func WithFlushTimeout(timeout time.Duration) Option

func WithLogger

func WithLogger(l *zap.Logger) Option

func WithMaxMPS

func WithMaxMPS(mps int) Option

func WithMetrics

func WithMetrics(r metrics.Registerer) Option

func WithNumWorkers

func WithNumWorkers(n int) Option

type Updater

type Updater interface {
	UpdateUserCounts(ctx context.Context, events environmentEventMap) map[string]bool
}

func NewEvalUserCountUpdater

func NewEvalUserCountUpdater(
	ctx context.Context,
	featureClient featureclient.Client,
	autoOpsClient aoclient.Client,
	eventCounterCache cachev3.EventCounterCache,
	autoOpsRulesCache cachev3.AutoOpsRulesCache,
	logger *zap.Logger,
) Updater

func NewGoalUserCountUpdater

func NewGoalUserCountUpdater(
	ctx context.Context,
	featureClient featureclient.Client,
	autoOpsClient aoclient.Client,
	eventCounterCache cachev3.EventCounterCache,
	autoOpsRulesCache cachev3.AutoOpsRulesCache,
	logger *zap.Logger,
) Updater

Jump to

Keyboard shortcuts

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