insight

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketLabel

type BucketLabel struct {
	Enabled  bool   `json:"enabled"`
	Template string `json:"template,omitempty"`
}

type Dashboard

type Dashboard struct {
	ID             string      `json:"id,omitempty"      elastic_meta:"_id" elastic_mapping:"id: { type: keyword }"`
	Created        time.Time   `json:"created,omitempty" elastic_mapping:"created: { type: date }"`
	Updated        time.Time   `json:"updated,omitempty" elastic_mapping:"updated: { type: date }"`
	ClusterId      string      `json:"cluster_id" elastic_mapping:"cluster_id: { type: keyword }"`
	IndexPattern   string      `json:"index_pattern" elastic_mapping:"index_pattern: { type: keyword }"`
	TimeField      string      `json:"time_field,omitempty" elastic_mapping:"time_field: { type: keyword }"`
	Filter         interface{} `json:"filter,omitempty" elastic_mapping:"filter: { type: object, enabled:false }"`
	BucketSize     string      `json:"bucket_size" elastic_mapping:"bucket_size: { type: keyword }"`
	Title          string      `json:"title"  elastic_mapping:"title: { type: keyword }"`
	Description    string      `json:"description" elastic_mapping:"description: { type: keyword }"`
	Visualizations interface{} `json:"visualizations"  elastic_mapping:"visualizations: { type: object, enabled:false }"`
	Tags           []string    `json:"tags,omitempty" elastic_mapping:"tags: { type: keyword }"`
	User           string      `json:"user" elastic_mapping:"user: { type: keyword }"`
	Query          interface{} `json:"query,omitempty" elastic_mapping:"query: { type: object, enabled:false }"`
	TimeFilter     interface{} `json:"time_filter,omitempty" elastic_mapping:"time_filter: { type: object, enabled:false }"`
}

type GroupSort

type GroupSort struct {
	Key       string `json:"key"`
	Direction string `json:"direction"`
}

type Metric

type Metric struct {
	AggTypes     []string          `json:"agg_types,omitempty"`
	IndexPattern string            `json:"index_pattern,omitempty"`
	TimeField    string            `json:"time_field,omitempty"`
	BucketSize   string            `json:"bucket_size,omitempty"`
	Filter       interface{}       `json:"filter,omitempty"`
	Groups       []MetricGroupItem `json:"groups,omitempty"` //bucket group
	Sort         []GroupSort       `json:"sort,omitempty"`
	ClusterId    string            `json:"cluster_id,omitempty"`
	Formula      string            `json:"formula,omitempty"`
	//array of formula for new version
	Formulas        []string     `json:"formulas,omitempty"`
	Items           []MetricItem `json:"items"`
	FormatType      string       `json:"format,omitempty"`
	TimeFilter      interface{}  `json:"time_filter,omitempty"`
	TimeBeforeGroup bool         `json:"time_before_group,omitempty"`
	BucketLabel     *BucketLabel `json:"bucket_label,omitempty"`
	// number of buckets to return, used for aggregation auto_date_histogram when bucket size equals 'auto'
	Buckets uint   `json:"buckets,omitempty"`
	Unit    string `json:"unit,omitempty"`
}

func (*Metric) AutoTimeBeforeGroup

func (m *Metric) AutoTimeBeforeGroup() bool

func (*Metric) GenerateExpression

func (m *Metric) GenerateExpression() (string, error)

func (*Metric) ValidateSortKey

func (m *Metric) ValidateSortKey() error

type MetricBase added in v1.28.0

type MetricBase struct {
	orm.ORMObjectBase
	//display name of the metric
	Name string `json:"name"`
	//metric identifier
	Key string `json:"key"`
	//optional values : "node", "indices", "shard"
	Level string `json:"level"`
	//metric calculation formula
	Formula    string       `json:"formula,omitempty"`
	Items      []MetricItem `json:"items"`
	FormatType string       `json:"format,omitempty"`
	Unit       string       `json:"unit,omitempty"`
	//determine if this metric is built-in
	Builtin bool `json:"builtin"`
	//array of supported calculation statistic, eg: "avg", "sum", "min", "max"
	Statistics []string `json:"statistics,omitempty"`
}

type MetricData

type MetricData struct {
	Groups     []string `json:"groups,omitempty"`
	Data       map[string][]MetricDataItem
	GroupLabel string `json:"group_label,omitempty"`
}

type MetricDataItem

type MetricDataItem struct {
	Timestamp  interface{} `json:"timestamp,omitempty"`
	Value      interface{} `json:"value"`
	Groups     []string    `json:"groups,omitempty"`
	GroupLabel string      `json:"group_label,omitempty"`
}

type MetricGroupItem

type MetricGroupItem struct {
	Field string `json:"field"`
	Limit int    `json:"limit"`
}

type MetricItem

type MetricItem struct {
	Name      string `json:"name,omitempty"`
	Field     string `json:"field"`
	FieldType string `json:"field_type,omitempty"`
	Statistic string `json:"statistic,omitempty"`
}

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
	H int `json:"h"`
	W int `json:"w"`
}

type SeriesItem

type SeriesItem struct {
	Type    string                 `json:"type"`
	Options map[string]interface{} `json:"options"`
	Metric  Metric                 `json:"metric"`
}

type Visualization

type Visualization struct {
	ID           string       `json:"id,omitempty"      elastic_meta:"_id" elastic_mapping:"id: { type: keyword }"`
	Created      *time.Time   `json:"created,omitempty" elastic_mapping:"created: { type: date }"`
	Updated      *time.Time   `json:"updated,omitempty" elastic_mapping:"updated: { type: date }"`
	Title        string       `json:"title,omitempty" elastic_mapping:"title: { type: keyword }"`
	IndexPattern string       `json:"index_pattern,omitempty" elastic_mapping:"index_pattern: { type: keyword }"`
	ClusterId    string       `json:"cluster_id,omitempty" elastic_mapping:"cluster_id: { type: keyword }"`
	Series       []SeriesItem `json:"series"  elastic_mapping:"series: { type: object,enabled:false }"`
	Position     *Position    `json:"position,omitempty" elastic_mapping:"position: { type: object,enabled:false }"`
	Description  string       `json:"description,omitempty" elastic_mapping:"description: { type: keyword }"`
}

type Widget

type Widget struct {
	orm.ORMObjectBase
	Title  string      `json:"title" elastic_mapping:"title: { type: text }"`
	Config interface{} `json:"config" elastic_mapping:"config: { type: object,enabled:false }"`
}

Jump to

Keyboard shortcuts

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