Documentation ¶
Index ¶
Constants ¶
View Source
const IndexPrefixAnomaliesDetection = "anomalies-detection"
View Source
const TemplateAnomaliesDetection = ` { "template": "*-` + IndexPrefixAnomaliesDetection + `", "version": 2, "mappings": { "` + TypeProductAnomaliesDetection + `": { "properties": { "account": { "type": "keyword" }, "date": { "type": "date" }, "product" : { "type": "keyword" }, "abnormal" : { "type": "boolean" }, "recurrent" : { "type": "boolean" }, "cost": { "type": "object", "properties": { "value": { "type": "double" }, "maxExpected": { "type": "double" } } } }, "_all": { "enabled": false }, "numeric_detection": false, "date_detection": false } } } `
View Source
const TemplateNameAnomaliesDetection = "anomalies-detection"
View Source
const TypeProductAnomaliesDetection = "product-anomalies-detection"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnalyzedCost ¶
type AnalyzedCost struct { Meta AnalyzedCostEssentialMeta Cost float64 UpperBand float64 Anomaly bool }
AnalyzedCost is returned by Bollinger Band algorithm and contains every necessary data for it. It also contains metadata, ignored by the algorithm.
type AnalyzedCostEssentialMeta ¶
type AnalyzedCostEssentialMeta struct { AdditionalMeta interface{} Date string }
AnalyzedCostEssentialMeta is the mandatory metadata ignored by the algorithm and contains the Date and an additional metadata with specialized values.
type AnalyzedCostProductMeta ¶
type AnalyzedCostProductMeta struct {
Product string
}
AnalyzedCostProductMeta can be the additional metadata in AnalyzedCostEssentialMeta. It's used to detect product anomalies and store them in ElasticSearch with more info.
type AnalyzedCosts ¶
type AnalyzedCosts []AnalyzedCost
type AnomalyEsQueryParams ¶
type AnomalyEsQueryParams struct { DateBegin time.Time DateEnd time.Time Account string Index string }
AnomalyEsQueryParams will store the parsed query params
type ElasticSearchFunction ¶
type ElasticSearchFunction func( account string, durationBegin time.Time, durationEnd time.Time, aggregationPeriod string, client *elastic.Client, index string, ) *elastic.SearchService
ElasticSearchFunction is a function passed to makeElasticSearchRequest, used to get results from ElasticSearch.
Click to show internal directories.
Click to hide internal directories.