Documentation
¶
Index ¶
- Variables
- func GetQueryLimiter(username string, cfg *config.Config, m *MultiTarget) (string, limiter.ServerLimiter)
- func GetQueryLimiterFrom(username string, cfg *config.Config, from, until int64) limiter.ServerLimiter
- func GetQueryParam(username string, cfg *config.Config, m *MultiTarget) (*config.QueryParam, int)
- type CHResponse
- type CHResponses
- type Cache
- type Data
- type FilteringFunctionsByTarget
- type MultiTarget
- type Targets
- type TimeFrame
Constants ¶
This section is empty.
Variables ¶
var ErrSetStepTimeout = errors.New("unexpected error, setStep timeout")
var ReadUvarint = clickhouse.ReadUvarint
ReadUvarint reads unsigned int with variable length
Functions ¶
func GetQueryLimiter ¶ added in v0.14.0
func GetQueryLimiter(username string, cfg *config.Config, m *MultiTarget) (string, limiter.ServerLimiter)
func GetQueryLimiterFrom ¶ added in v0.14.0
func GetQueryParam ¶ added in v0.14.0
func GetQueryParam(username string, cfg *config.Config, m *MultiTarget) (*config.QueryParam, int)
Types ¶
type CHResponse ¶
type CHResponse struct { Data *Data From int64 Until int64 // if true, return points for all metrics, replacing empty results with list of NaN AppendOutEmptySeries bool AppliedFunctions map[string][]string }
CHResponse contains the parsed Data and From/Until timestamps
func (*CHResponse) ToMultiFetchResponseV2 ¶
func (c *CHResponse) ToMultiFetchResponseV2() (*v2pb.MultiFetchResponse, error)
ToMultiFetchResponseV2 returns protobuf v2pb.MultiFetchResponse message for given CHResponse
func (*CHResponse) ToMultiFetchResponseV3 ¶
func (c *CHResponse) ToMultiFetchResponseV3() (*v3pb.MultiFetchResponse, error)
ToMultiFetchResponseV3 returns protobuf v3pb.MultiFetchResponse message for given CHResponse
type CHResponses ¶
type CHResponses []CHResponse
CHResponses is a slice of CHResponse
func EmptyResponse ¶
func EmptyResponse() CHResponses
EmptyResponse returns an CHResponses with one element containing emptyData for the following encoding
func (*CHResponses) ToMultiFetchResponseV2 ¶
func (cc *CHResponses) ToMultiFetchResponseV2() (*v2pb.MultiFetchResponse, error)
ToMultiFetchResponseV2 returns protobuf v2pb.MultiFetchResponse message for given CHResponses
func (*CHResponses) ToMultiFetchResponseV3 ¶
func (cc *CHResponses) ToMultiFetchResponseV3() (*v3pb.MultiFetchResponse, error)
ToMultiFetchResponseV3 returns protobuf v3pb.MultiFetchResponse message for given CHResponses
type Data ¶
Data stores parsed response from ClickHouse server
func (*Data) GetAggregation ¶
GetAggregation returns the generic whisper compatible name for an aggregation of metric with ID id
type FilteringFunctionsByTarget ¶ added in v0.14.0
type FilteringFunctionsByTarget map[string][]*v3pb.FilteringFunction
type MultiTarget ¶
MultiTarget is a map of TimeFrame keys and targets slice of strings values
func MFRToMultiTarget ¶
func MFRToMultiTarget(v3Request *v3pb.MultiFetchRequest) MultiTarget
func (*MultiTarget) Fetch ¶
func (m *MultiTarget) Fetch(ctx context.Context, cfg *config.Config, chContext string, qlimiter limiter.ServerLimiter, queueDuration *time.Duration) (CHResponses, error)
Fetch fetches the parsed ClickHouse data returns CHResponses
type Targets ¶
type Targets struct { // List contains queried metrics, e.g. [metric.{name1,name2}, metric.name[3-9]] List []string Cache []Cache Cached bool // all is cached // AM stores found expanded metrics AM *alias.Map // contains filtered or unexported fields }
Targets represents requested metrics
func NewTargetsOne ¶ added in v0.14.0
func (*Targets) GetRequestedAggregation ¶ added in v0.14.0
func (*Targets) SetFilteringFunctions ¶ added in v0.14.0
func (tt *Targets) SetFilteringFunctions(target string, filteringFunctions []*v3pb.FilteringFunction)