telemetry

package
v5.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// Treatment getTreatment
	Treatment = "treatment"
	// Treatments getTreatments
	Treatments = "treatments"
	// TreatmentWithConfig getTreatmentWithConfig
	TreatmentWithConfig = "treatmentWithConfig"
	// TreatmentsWithConfig getTreatmentsWithConfig
	TreatmentsWithConfig = "treatmentsWithConfig"
	// TreatmentsByFlagSet getTreatmentsByFlagSet
	TreatmentsByFlagSet = "treatmentsByFlagSet"
	// TreatmentsByFlagSets getTreatmentsByFlagSets
	TreatmentsByFlagSets = "treatmentsByFlagSets"
	// TreatmentsWithConfigByFlagSet getTreatmentsWithConfigByFlagSet
	TreatmentsWithConfigByFlagSet = "treatmentsWithConfigByFlagSet"
	// TreatmentsWithConfigByFlagSets getTreatmentsWithConfigByFlagSets
	TreatmentsWithConfigByFlagSets = "treatmentsWithConfigByFlagSets"
	// Track track
	Track = "track"
)
View Source
const (
	// SplitSync splitChanges
	SplitSync = iota
	// SegmentSync segmentChanges
	SegmentSync
	// ImpressionSync impressions
	ImpressionSync
	// ImpressionCountSync impressionsCount
	ImpressionCountSync
	// EventSync events
	EventSync
	// TelemetrySync telemetry
	TelemetrySync
	// TokenSync auth
	TokenSync
)
View Source
const (
	// ImpressionsDropped dropped
	ImpressionsDropped = iota
	// ImpressionsDeduped deduped
	ImpressionsDeduped
	// ImpressionsQueued queued
	ImpressionsQueued
)
View Source
const (
	// EventsDropped dropped
	EventsDropped = iota
	// EventsQueued queued
	EventsQueued
)
View Source
const (
	// LatencyBucketCount Max buckets
	LatencyBucketCount = 23
	// MaxStreamingEvents Max streaming events allowed
	MaxStreamingEvents = 20
	// MaxTags Max tags
	MaxTags = 10
)
View Source
const (
	EventTypeSSEConnectionEstablished = iota * 10
	EventTypeOccupancyPri
	EventTypeOccupancySec
	EventTypeStreamingStatus
	EventTypeConnectionError
	EventTypeTokenRefresh
	EventTypeAblyError
	EventTypeSyncMode
)
View Source
const (
	StreamingDisabled = iota
	StreamingEnabled
	StreamingPaused
)
View Source
const (
	Requested = iota
	NonRequested
)
View Source
const (
	Streaming = iota
	Polling
)
View Source
const (
	Standalone = iota
	Consumer
	Producer
)
View Source
const (
	ImpressionsModeOptimized = iota
	ImpressionsModeDebug
	ImpressionsModeNone
)
View Source
const (
	Redis  = "redis"
	Memory = "memory"
)
View Source
const (
	SplitUpdate = iota
)

Variables

This section is empty.

Functions

func Bucket

func Bucket(latency int64) int

Bucket returns the bucket where the received latency falls

func GetStreamingEvent

func GetStreamingEvent(eventType int, data int64) *dtos.StreamingEvent

GetStreamingEvent get streaming event

func IsMethodValid

func IsMethodValid(method *string) bool

IsMethodValid returs true if the supplied method name is valid

func ParseMethodFromRedisHash

func ParseMethodFromRedisHash(method string) (normalized string, ok bool)

ParseMethodFromRedisHash parses the method in a latency/exception hash from redis and returns it's normalized version, or `ok` set to false

Types

type InitConfig

type InitConfig struct {
	AdvancedConfig  conf.AdvancedConfig
	TaskPeriods     conf.TaskPeriods
	ImpressionsMode string
	ListenerEnabled bool
	FlagSetsTotal   int64
	FlagSetsInvalid int64
}

InitConfig involves entire config for init

type NoOp

type NoOp struct{}

func (*NoOp) SynchronizeConfig

func (n *NoOp) SynchronizeConfig(cfg InitConfig, timedUntilReady int64, factoryInstances map[string]int64, tags []string)

func (*NoOp) SynchronizeStats

func (n *NoOp) SynchronizeStats() error

func (*NoOp) SynchronizeUniqueKeys

func (n *NoOp) SynchronizeUniqueKeys(uniques dtos.Uniques) error

type RecorderSingle

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

RecorderSingle struct for telemetry sync

func (*RecorderSingle) SynchronizeConfig

func (e *RecorderSingle) SynchronizeConfig(cfg InitConfig, timedUntilReady int64, factoryInstances map[string]int64, tags []string)

SynchronizeConfig syncs telemetry config

func (*RecorderSingle) SynchronizeStats

func (e *RecorderSingle) SynchronizeStats() error

SynchronizeStats syncs telemetry stats

func (*RecorderSingle) SynchronizeUniqueKeys

func (e *RecorderSingle) SynchronizeUniqueKeys(uniques dtos.Uniques) error

SynchronizeUniqueKeys syncs unique keys

type SynchronizerRedis

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

SynchronizerRedis struct

func (*SynchronizerRedis) SynchronizeConfig

func (r *SynchronizerRedis) SynchronizeConfig(cfg InitConfig, timedUntilReady int64, factoryInstances map[string]int64, tags []string)

SynchronizeConfig syncs config

func (*SynchronizerRedis) SynchronizeStats

func (r *SynchronizerRedis) SynchronizeStats() error

SynchronizeStats no-op

func (*SynchronizerRedis) SynchronizeUniqueKeys

func (r *SynchronizerRedis) SynchronizeUniqueKeys(uniques dtos.Uniques) error

SynchronizeUniqueKeys syncs unique keys

type TelemetrySynchronizer

type TelemetrySynchronizer interface {
	SynchronizeConfig(cfg InitConfig, timedUntilReady int64, factoryInstances map[string]int64, tags []string)
	SynchronizeStats() error
	SynchronizeUniqueKeys(uniques dtos.Uniques) error
}

TelemetrySynchronizer interface

func NewSynchronizerRedis

func NewSynchronizerRedis(storage storage.TelemetryConfigProducer, logger logging.LoggerInterface) TelemetrySynchronizer

NewSynchronizerRedis constructor

func NewTelemetrySynchronizer

func NewTelemetrySynchronizer(
	telemetryStorage storage.TelemetryStorageConsumer,
	telemetryRecorder service.TelemetryRecorder,
	splitStorage storage.SplitStorageConsumer,
	segmentStorage storage.SegmentStorageConsumer,
	logger logging.LoggerInterface,
	metadata dtos.Metadata,
	runtimeTelemetry storage.TelemetryRuntimeProducer,
) TelemetrySynchronizer

NewTelemetrySynchronizer creates new event synchronizer for posting events

Jump to

Keyboard shortcuts

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