v1

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemGroupKey         = "system"
	OperationGroupKey      = "operations"
	LatencyGroupKey        = "latency"
	CacheGroupKey          = "cache"
	HttpGroupKey           = "http"
	MemoryGroupKey         = "memory"
	StorageGroupKey        = "storage"
	JVMGroupKey            = "JVM"
	TransportGroupKey      = "transport"
	DocumentGroupKey       = "document"
	IOGroupKey             = "io"
	CircuitBreakerGroupKey = "circuit_breaker"
)
View Source
const (
	ThreadPoolGetGroupKey        = "thread_pool_get"
	ThreadPoolSearchGroupKey     = "thread_pool_search"
	ThreadPoolFlushGroupKey      = "thread_pool_flush"
	ThreadPoolRefreshGroupKey    = "thread_pool_refresh"
	ThreadPoolWriteGroupKey      = "thread_pool_write"
	ThreadPoolForceMergeGroupKey = "thread_pool_force_merge"
	ThreadPoolIndexGroupKey      = "thread_pool_index"
	ThreadPoolBulkGroupKey       = "thread_pool_bulk"
)

Variables

This section is empty.

Functions

func ConvertBucketItemsToAggQuery

func ConvertBucketItemsToAggQuery(bucketItems []*common.BucketItem, metricItems []*common.MetricItem) util.MapStr

func ConvertMetricItemsToAggQuery

func ConvertMetricItemsToAggQuery(metricItems []*common.MetricItem) map[string]interface{}

func GetMetricRangeAndBucketSize

func GetMetricRangeAndBucketSize(minStr string, maxStr string, bucketSize int, metricCount int) (int, int64, int64, error)

func GetMinBucketSize

func GetMinBucketSize() int

Types

type APIHandler

type APIHandler struct {
	core.Handler
	Config common.ModuleConfig
}

func (*APIHandler) Client

func (h *APIHandler) Client() elastic.API

func (*APIHandler) FetchClusterInfo

func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) FetchIndexInfo

func (h *APIHandler) FetchIndexInfo(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) FetchNodeInfo

func (h *APIHandler) FetchNodeInfo(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetClusterClient

func (h *APIHandler) GetClusterClient(id string) (bool, elastic.API, error)

TODO use prefered client

func (*APIHandler) GetClusterHealth

func (h *APIHandler) GetClusterHealth(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetClusterIndexMetrics

func (h *APIHandler) GetClusterIndexMetrics(id string, bucketSize int, min, max int64) map[string]*common.MetricItem

func (*APIHandler) GetClusterIndices

func (h *APIHandler) GetClusterIndices(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetClusterInfo

func (h *APIHandler) GetClusterInfo(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetClusterMetrics

func (h *APIHandler) GetClusterMetrics(id string, bucketSize int, min, max int64) map[string]*common.MetricItem

func (*APIHandler) GetClusterNodes

func (h *APIHandler) GetClusterNodes(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetClusterStatusAction

func (h *APIHandler) GetClusterStatusAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetHosts

func (h *APIHandler) GetHosts(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetIndexInfo

func (h *APIHandler) GetIndexInfo(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetIndexShards

func (h *APIHandler) GetIndexShards(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetMetadata

func (h *APIHandler) GetMetadata(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetMetadataByID

func (h *APIHandler) GetMetadataByID(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetNodeInfo

func (h *APIHandler) GetNodeInfo(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetNodeShards

func (h *APIHandler) GetNodeShards(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetRealtimeClusterIndices

func (h *APIHandler) GetRealtimeClusterIndices(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetRealtimeClusterNodes

func (h *APIHandler) GetRealtimeClusterNodes(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetSingleIndexMetrics

func (h *APIHandler) GetSingleIndexMetrics(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) GetSingleNodeMetrics

func (h *APIHandler) GetSingleNodeMetrics(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleClusterMetricsAction

func (h *APIHandler) HandleClusterMetricsAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

new

func (*APIHandler) HandleCreateClusterAction

func (h *APIHandler) HandleCreateClusterAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleDeleteClusterAction

func (h *APIHandler) HandleDeleteClusterAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleGetClusterAction

func (h *APIHandler) HandleGetClusterAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleGetNodesAction

func (h *APIHandler) HandleGetNodesAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleGetStorageMetricAction

func (h *APIHandler) HandleGetStorageMetricAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleIndexMetricsAction

func (h *APIHandler) HandleIndexMetricsAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleMetricsSummaryAction

func (h *APIHandler) HandleMetricsSummaryAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleNodeMetricsAction

func (h *APIHandler) HandleNodeMetricsAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleQueueMetricsAction

func (h *APIHandler) HandleQueueMetricsAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleSearchClusterAction

func (h *APIHandler) HandleSearchClusterAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) HandleUpdateClusterAction

func (h *APIHandler) HandleUpdateClusterAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (APIHandler) ListIndex

func (h APIHandler) ListIndex(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) QueryQPS

func (h *APIHandler) QueryQPS(query util.MapStr, bucketSizeInSeconds int) (map[string]util.MapStr, error)

func (*APIHandler) SearchClusterMetadata

func (h *APIHandler) SearchClusterMetadata(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) SearchIndexMetadata

func (h *APIHandler) SearchIndexMetadata(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

func (*APIHandler) SearchNodeMetadata

func (h *APIHandler) SearchNodeMetadata(w http.ResponseWriter, req *http.Request, ps httprouter.Params)

type Bucket

type Bucket struct {
	BucketBase //子 buckets

	KeyAsString             string      `json:"key_as_string,omitempty"`
	Key                     interface{} `json:"key,omitempty"`
	DocCount                int64       `json:"doc_count,omitempty"`
	DocCountErrorUpperBound int64       `json:"doc_count_error_upper_bound,omitempty"`
	SumOtherDocCount        int64       `json:"sum_other_doc_count,omitempty"`

	Buckets []Bucket `json:"buckets,omitempty"` //本 buckets
}

type BucketBase

type BucketBase map[string]interface{}

func (BucketBase) GetChildBucket

func (receiver BucketBase) GetChildBucket(name string) (map[string]interface{}, bool)

type CatNodeResponse

type CatNodeResponse elastic.CatNodeResponse

type GroupMetricItem

type GroupMetricItem struct {
	Key          string
	Field        string
	ID           string
	IsDerivative bool
	Units        string
	FormatType   string
	MetricItem   *common.MetricItem
	Field2       string
	Calc         func(value, value2 float64) float64
}

type IndexInfo

type IndexInfo elastic.IndexInfo

type MetricData

type MetricData map[string][][]interface{}

func ParseAggregationBucketResult

func ParseAggregationBucketResult(bucketSize int, aggsData util.MapStr, groupKey, resultLabelKey, resultValueKey string, resultItemHandle func()) MetricData

func ParseAggregationResult

func ParseAggregationResult(bucketSize int, aggsData util.MapStr, groupKey, metricLabelKey, metricValueKey string) MetricData

type RealtimeIndexInfo

type RealtimeIndexInfo struct {
	IndexQPS      interface{} `json:"index_qps"`
	QueryQPS      interface{} `json:"query_qps"`
	IndexBytesQPS interface{} `json:"index_bytes_qps"`
	IndexInfo
}

type RealtimeNodeInfo

type RealtimeNodeInfo struct {
	IndexQPS      interface{} `json:"index_qps"`
	QueryQPS      interface{} `json:"query_qps"`
	IndexBytesQPS interface{} `json:"index_bytes_qps"`
	CatNodeResponse
}

type SearchResponse

type SearchResponse struct {
	Took     int  `json:"took"`
	TimedOut bool `json:"timed_out"`
	Hits     struct {
		Total    interface{} `json:"total"`
		MaxScore float32     `json:"max_score"`
	} `json:"hits"`
	Aggregations util.MapStr `json:"aggregations,omitempty"`
}

type TopTerm

type TopTerm struct {
	Key   string
	Value float64
}

type TopTermOrder

type TopTermOrder []TopTerm

func (TopTermOrder) Len

func (t TopTermOrder) Len() int

func (TopTermOrder) Less

func (t TopTermOrder) Less(i, j int) bool

func (TopTermOrder) Swap

func (t TopTermOrder) Swap(i, j int)

type TreeMapNode

type TreeMapNode struct {
	Name     string         `json:"name"`
	Value    float64        `json:"value,omitempty"`
	Children []*TreeMapNode `json:"children,omitempty"`
	SubKeys  map[string]int `json:"-"`
}

Jump to

Keyboard shortcuts

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