query

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: Apache-2.0 Imports: 11 Imported by: 3

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 Init

func Init(cfg SeriesQuerySection)

func NewQueryRequest

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

func Query

func Query(reqs []*dataobj.QueryData) ([]*dataobj.TsdbQueryResponse, error)

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

Types

type Counter

type Counter struct {
	Counter string `json:"counter"`
	Step    int    `json:"step"`
	Dstype  string `json:"dstype"`
}

type IndexData

type IndexData struct {
	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 {
	Endpoints []string       `json:"endpoints"`
	Metric    string         `json:"metric"`
	Include   []XCludeStruct `json:"include,omitempty"`
	Exclude   []XCludeStruct `json:"exclude,omitempty"`
}

type IndexRequest

type IndexRequest struct {
	Endpoints []string            `json:"endpoints"`
	Metric    string              `json:"metric"`
	Include   map[string][]string `json:"include"`
	Exclude   map[string][]string `json:"exclude"`
}

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"` // 请求超时
	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