query

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorIndexParamIllegal = errors.New("index param illegal")
	ErrorQueryParamIllegal = errors.New("query param illegal")
)

Functions

func Counter2Metric

func Counter2Metric(counter string) (string, map[string]string)

func GetIndex

func GetIndex()

func GetIndexLoop

func GetIndexLoop()

func Init

func Init(cfg SeriesQuerySection)

func NewQueryRequest

func NewQueryRequest(nid, endpoint, metric string, tagsMap map[string]string,
	step int, start, end int64) (*dataobj.QueryData, error)

func Query

func Query(reqs []*dataobj.QueryData, stra *models.Stra, expFunc string) []*dataobj.TsdbQueryResponse

执行Query操作 默认不重试, 如果要做重试, 在这里完成

func QueryFromMem

func QueryFromMem(reqs []*dataobj.QueryData, stra *models.Stra) ([]*dataobj.TsdbQueryResponse, []*dataobj.QueryData)

Types

type IndexAddrs

type IndexAddrs struct {
	sync.RWMutex
	Data []string
}
var IndexList IndexAddrs

func (*IndexAddrs) Get

func (i *IndexAddrs) Get() []string

func (*IndexAddrs) Set

func (i *IndexAddrs) Set(addrs []string)

type IndexData

type IndexData struct {
	Nid      string   `json:"nid"`
	Endpoint string   `json:"endpoint"`
	Metric   string   `json:"metric"`
	Tags     []string `json:"tags"`
	Step     int      `json:"step"`
	Dstype   string   `json:"dstype"`
}

func Xclude

func Xclude(request *IndexReq) ([]IndexData, error)

index的xclude 不支持批量查询, 暂时不做

type IndexReq

type IndexReq struct {
	Nids      []string       `json:"nids"`
	Endpoints []string       `json:"endpoints"`
	Metric    string         `json:"metric"`
	Include   []XCludeStruct `json:"include,omitempty"`
	Exclude   []XCludeStruct `json:"exclude,omitempty"`
}

type IndexResp

type IndexResp struct {
	Data []IndexData `json:"dat"`
	Err  string      `json:"err"`
}

type SeriesQuerySection

type SeriesQuerySection struct {
	MaxConn          int    `json:"maxConn"`     //
	MaxIdle          int    `json:"maxIdle"`     //
	ConnTimeout      int    `json:"connTimeout"` // 连接超时
	CallTimeout      int    `json:"callTimeout"` // 请求超时
	IndexMod         string `json:"indexMod"`
	IndexPath        string `json:"indexPath"`
	IndexCallTimeout int    `json:"indexCallTimeout"` // 请求超时
}
var (
	TransferConnPools *pools.ConnPools

	Config SeriesQuerySection
)

type XCludeStruct

type XCludeStruct struct {
	Tagk string   `json:"tagk"`
	Tagv []string `json:"tagv"`
}

******** 补全索引相关 ********

Jump to

Keyboard shortcuts

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