Documentation
¶
Index ¶
- func New(db *database.DB, providePredictorFn predictor.ProvideFn, ...) (*manager, error)
- type CollectPredictor
- type Collector
- type Config
- type Manager
- type Option
- func WithAllowAppendData(t bool) Option
- func WithAllowAppendOutlier(t bool) Option
- func WithDBFlushSize(n int) Option
- func WithDBFlushTime(t time.Duration) Option
- func WithMaxItemsStored(n int) Option
- func WithMaxStorageTime(t time.Duration) Option
- func WithRebuildDBTime(t time.Duration) Option
- func WithSkipItems(n int) Option
- type Options
- type Predictor
- type ProvideFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CollectPredictor ¶
Aggregation interface for Collector and Predictor interfaces
type Collector ¶
type Collector interface { // The method accepts data from outside and writes it to the queue Collect(in ...model.Metric) error }
Collector defines the behavior of the service for data storage and analysis
type Config ¶
type Config struct { // Timer for performing data cleaning operations in the DB RebuildDBTime time.Duration `envconfig:"SOD_OUTLIER_REBUILD_DB_TIME" default:"15s"` // Skipping the first n metrics that are not passed through predictor, accumulating the dataset SkipItems int `envconfig:"SOD_OUTLIER_SKIP_ITEMS"` // maximum number of elements in the DB for each entity MaxItemsStored int `envconfig:"SOD_OUTLIER_MAX_ITEMS_STORED" default:"1000000"` // maximum retention period for elements in the DB for each entity MaxStorageTime time.Duration `envconfig:"SOD_OUTLIER_MAX_STORAGE_TIME" default:"0s"` // Critical buffer size in dbTxExecutor DP where data is flushed to disk DBFlushSize int `envconfig:"SOD_DB_FLUSH_SIZE" default:"10"` // Critical time of life in dbTxExecutor buffer in which data to be flushed to disk DBFlushTime time.Duration `envconfig:"SOD_DB_FLUSH_TIME" default:"5s"` // Allow adding data to the dataset AllowAppendData bool `envconfig:"SOD_OUTLIER_ALLOW_APPEND_DATA" default:"true"` // Allow adding outliers to the dataset AllowAppendOutlier bool `envconfig:"SOD_OUTLIER_ALLOW_APPEND_OUTLIER" default:"true"` }
type Manager ¶
type Manager interface { CollectPredictor // Start method of the service Run(context.Context) error // Method for stopping the service Stop() }
The interface defines the behavior of the Manager instance with all available methods. This interface defines the behavior of the background service.
type Option ¶
type Option func(*manager)
func WithAllowAppendData ¶
func WithAllowAppendOutlier ¶
func WithDBFlushSize ¶
func WithDBFlushTime ¶
func WithMaxItemsStored ¶
func WithMaxStorageTime ¶
func WithRebuildDBTime ¶
func WithSkipItems ¶
Click to show internal directories.
Click to hide internal directories.