services

package
v0.0.0-...-d328d9e Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExperimentService

type ExperimentService interface {
	// GetExperiment returns experiment after filtering based on required request parameters
	GetExperiment(
		projectId models.ProjectId,
		requestFilter map[string][]*_segmenters.SegmenterValue,
	) ([]models.SegmentFilter, *_pubsub.Experiment, error)
	// DumpExperiments dumps the data in the local storage as a JSON file, in the specified location,
	// and responds with the full file path
	DumpExperiments(directory string) (string, error)
}

func NewExperimentService

func NewExperimentService(
	localStorage *models.LocalStorage,
) (ExperimentService, error)

type MetricService

type MetricService interface {
	LogFetchTreatmentMetrics(
		begin time.Time,
		projectId models.ProjectId,
		treatment schema.SelectedTreatment,
		requestFilter map[string][]*_segmenters.SegmenterValue,
		statusCode int,
	)
	LogLatencyHistogram(begin time.Time, labels map[string]string, loggingMetric metrics.MetricName)
	LogRequestCount(labels map[string]string, loggingMetric metrics.MetricName)

	// GetProjectNameLabel retrieves only project name as labels
	GetProjectNameLabel(projectId models.ProjectId) map[string]string
	GetMetricLabels() []string
	// GetLabels retrieves labels with flag to filter for segmenters
	GetLabels(projectId models.ProjectId, treatment schema.SelectedTreatment, statusCode int,
		requestFilter map[string][]*_segmenters.SegmenterValue, withSegmenters bool) map[string]string
	SetMetricsCollector(collector metrics.Collector)
}

func NewMetricService

func NewMetricService(cfg config.Monitoring, localStorage *models.LocalStorage) (MetricService, error)

type ProjectSettingsNotFoundError

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

func ProjectSettingsNotFound

func ProjectSettingsNotFound(message string) *ProjectSettingsNotFoundError

func (*ProjectSettingsNotFoundError) Error

type RandomizationKeyNotFoundError

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

func RandomizationKeyNotFound

func RandomizationKeyNotFound(message string) *RandomizationKeyNotFoundError

func (*RandomizationKeyNotFoundError) Error

type SchemaService

type SchemaService interface {
	// GetRandomizationKeyValue retrieves the value of Randomization key based on projectId
	GetRandomizationKeyValue(projectId models.ProjectId, filterParams map[string]interface{}) (*string, error)

	// GetRequestFilter retrieves required request parameters based on projectId and builds a typed filter
	// for matching experiments
	GetRequestFilter(
		projectId models.ProjectId,
		filterParams map[string]interface{},
	) (map[string][]*_segmenters.SegmenterValue, error)

	// ValidatePasskey validates whether required passkey is provided based on projectId
	ValidatePasskey(projectId models.ProjectId, passkey string) error
}

func NewSchemaService

func NewSchemaService(
	projectSettingsStorage models.ProjectSettingsStorage,
	segmenterService SegmenterService,
) (SchemaService, error)

type SegmenterService

type SegmenterService interface {
	GetTransformation(
		id models.ProjectId,
		segmenter string,
		requestValues map[string]interface{},
		experimentVariables []string) ([]*_segmenters.SegmenterValue, error)
}

func NewSegmenterService

func NewSegmenterService(
	localStorage *models.LocalStorage,
	cfg map[string]interface{},
) (SegmenterService, error)

type TreatmentService

type TreatmentService interface {
	// GetTreatment returns treatment based on provided experiment. If the experiment's type is Switchback,
	// the window Id is also returned.
	GetTreatment(experiment *_pubsub.Experiment, randomizationValue *string) (*_pubsub.ExperimentTreatment, *int64, error)
}

func NewTreatmentService

func NewTreatmentService(localStorage *models.LocalStorage) (TreatmentService, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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