getoverallbuckets

package
v8.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Get overall bucket results.

Retrievs overall bucket results that summarize the bucket results of multiple anomaly detection jobs.

The `overall_score` is calculated by combining the scores of all the buckets within the overall bucket span. First, the maximum `anomaly_score` per anomaly detection job in the overall bucket is calculated. Then the `top_n` of those scores are averaged to result in the `overall_score`. This means that you can fine-tune the `overall_score` so that it is more or less sensitive to the number of jobs that detect an anomaly at the same time. For example, if you set `top_n` to `1`, the `overall_score` is the maximum bucket score in the overall bucket. Alternatively, if you set `top_n` to the number of jobs, the `overall_score` is high only when all jobs detect anomalies in that overall bucket. If you set the `bucket_span` parameter (to a value greater than its default), the `overall_score` is the maximum `overall_score` of the overall buckets that have a span equal to the jobs' largest bucket span.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

type GetOverallBuckets

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

func New

Get overall bucket results.

Retrievs overall bucket results that summarize the bucket results of multiple anomaly detection jobs.

The `overall_score` is calculated by combining the scores of all the buckets within the overall bucket span. First, the maximum `anomaly_score` per anomaly detection job in the overall bucket is calculated. Then the `top_n` of those scores are averaged to result in the `overall_score`. This means that you can fine-tune the `overall_score` so that it is more or less sensitive to the number of jobs that detect an anomaly at the same time. For example, if you set `top_n` to `1`, the `overall_score` is the maximum bucket score in the overall bucket. Alternatively, if you set `top_n` to the number of jobs, the `overall_score` is high only when all jobs detect anomalies in that overall bucket. If you set the `bucket_span` parameter (to a value greater than its default), the `overall_score` is the maximum `overall_score` of the overall buckets that have a span equal to the jobs' largest bucket span.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html

func (*GetOverallBuckets) AllowNoMatch

func (r *GetOverallBuckets) AllowNoMatch(allownomatch bool) *GetOverallBuckets

AllowNoMatch Refer to the description for the `allow_no_match` query parameter. API name: allow_no_match

func (*GetOverallBuckets) BucketSpan

func (r *GetOverallBuckets) BucketSpan(duration types.Duration) *GetOverallBuckets

BucketSpan Refer to the description for the `bucket_span` query parameter. API name: bucket_span

func (GetOverallBuckets) Do

func (r GetOverallBuckets) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a getoverallbuckets.Response

func (*GetOverallBuckets) End

End Refer to the description for the `end` query parameter. API name: end

func (*GetOverallBuckets) ErrorTrace added in v8.14.0

func (r *GetOverallBuckets) ErrorTrace(errortrace bool) *GetOverallBuckets

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*GetOverallBuckets) ExcludeInterim

func (r *GetOverallBuckets) ExcludeInterim(excludeinterim bool) *GetOverallBuckets

ExcludeInterim Refer to the description for the `exclude_interim` query parameter. API name: exclude_interim

func (*GetOverallBuckets) FilterPath added in v8.14.0

func (r *GetOverallBuckets) FilterPath(filterpaths ...string) *GetOverallBuckets

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*GetOverallBuckets) Header

func (r *GetOverallBuckets) Header(key, value string) *GetOverallBuckets

Header set a key, value pair in the GetOverallBuckets headers map.

func (*GetOverallBuckets) HttpRequest

func (r *GetOverallBuckets) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*GetOverallBuckets) Human added in v8.14.0

func (r *GetOverallBuckets) Human(human bool) *GetOverallBuckets

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func (*GetOverallBuckets) OverallScore

func (r *GetOverallBuckets) OverallScore(overallscore string) *GetOverallBuckets

OverallScore Refer to the description for the `overall_score` query parameter. API name: overall_score

func (GetOverallBuckets) Perform added in v8.7.0

func (r GetOverallBuckets) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*GetOverallBuckets) Pretty added in v8.14.0

func (r *GetOverallBuckets) Pretty(pretty bool) *GetOverallBuckets

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*GetOverallBuckets) Raw

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*GetOverallBuckets) Request

func (r *GetOverallBuckets) Request(req *Request) *GetOverallBuckets

Request allows to set the request property with the appropriate payload.

func (*GetOverallBuckets) Start

func (r *GetOverallBuckets) Start(datetime types.DateTime) *GetOverallBuckets

Start Refer to the description for the `start` query parameter. API name: start

func (*GetOverallBuckets) TopN

func (r *GetOverallBuckets) TopN(topn int) *GetOverallBuckets

TopN Refer to the description for the `top_n` query parameter. API name: top_n

type NewGetOverallBuckets

type NewGetOverallBuckets func(jobid string) *GetOverallBuckets

NewGetOverallBuckets type alias for index.

func NewGetOverallBucketsFunc

func NewGetOverallBucketsFunc(tp elastictransport.Interface) NewGetOverallBuckets

NewGetOverallBucketsFunc returns a new instance of GetOverallBuckets with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type Request

type Request struct {

	// AllowNoMatch Refer to the description for the `allow_no_match` query parameter.
	AllowNoMatch *bool `json:"allow_no_match,omitempty"`
	// BucketSpan Refer to the description for the `bucket_span` query parameter.
	BucketSpan types.Duration `json:"bucket_span,omitempty"`
	// End Refer to the description for the `end` query parameter.
	End types.DateTime `json:"end,omitempty"`
	// ExcludeInterim Refer to the description for the `exclude_interim` query parameter.
	ExcludeInterim *bool `json:"exclude_interim,omitempty"`
	// OverallScore Refer to the description for the `overall_score` query parameter.
	OverallScore string `json:"overall_score,omitempty"`
	// Start Refer to the description for the `start` query parameter.
	Start types.DateTime `json:"start,omitempty"`
	// TopN Refer to the description for the `top_n` query parameter.
	TopN *int `json:"top_n,omitempty"`
}

Request holds the request body struct for the package getoverallbuckets

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/ml/get_overall_buckets/MlGetOverallBucketsRequest.ts#L25-L146

func NewRequest added in v8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.5.0

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON added in v8.12.1

func (s *Request) UnmarshalJSON(data []byte) error

type Response added in v8.7.0

type Response struct {
	Count int64 `json:"count"`
	// OverallBuckets Array of overall bucket objects
	OverallBuckets []types.OverallBucket `json:"overall_buckets"`
}

Response holds the response body struct for the package getoverallbuckets

https://github.com/elastic/elasticsearch-specification/blob/4fcf747dfafc951e1dcf3077327e3dcee9107db3/specification/ml/get_overall_buckets/MlGetOverallBucketsResponse.ts#L23-L29

func NewResponse added in v8.7.0

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

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