query

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServerError

func NewServerError(body []byte) error

Types

type FieldCondition

type FieldCondition struct {
	// contains filtered or unexported fields
}

type FilterCondition

type FilterCondition struct {
	Key, Op, Val string
}

type FuncCondition

type FuncCondition struct {
	Name, Field string
}

type GroupCondition

type GroupCondition string

type MetricQuery

type MetricQuery interface {
	QueryMetric(req *MetricQueryRequest) (*MetricQueryResponse, error)

	SetTimeout(duration time.Duration)
}

type MetricQueryRequest

type MetricQueryRequest struct {
	// contains filtered or unexported fields
}

func CreateQueryRequest

func CreateQueryRequest(metricName string) *MetricQueryRequest

func (*MetricQueryRequest) Align

func (*MetricQueryRequest) Apply

func (req *MetricQueryRequest) Apply(funcName, field string) *MetricQueryRequest

see:https://yuque.antfin.com/spot/develop-docs/hr2c1y#f14b2b31

func (*MetricQueryRequest) ConstructParam

func (req *MetricQueryRequest) ConstructParam() *url.Values

func (*MetricQueryRequest) EndWith

func (req *MetricQueryRequest) EndWith(end time.Time) *MetricQueryRequest

func (*MetricQueryRequest) Field

func (req *MetricQueryRequest) Field(key string) *FieldCondition

func (*MetricQueryRequest) Filter

func (req *MetricQueryRequest) Filter(key, val string) *MetricQueryRequest

func (*MetricQueryRequest) FormatAs

func (req *MetricQueryRequest) FormatAs(format string) *MetricQueryRequest

chart: chartv2:

func (*MetricQueryRequest) GroupBy

func (req *MetricQueryRequest) GroupBy(groups []string) *MetricQueryRequest

func (*MetricQueryRequest) In

func (req *MetricQueryRequest) In(key string, values []string) *MetricQueryRequest

func (*MetricQueryRequest) LimitGroup

func (req *MetricQueryRequest) LimitGroup(limit int) *MetricQueryRequest

func (*MetricQueryRequest) LimitPoint

func (req *MetricQueryRequest) LimitPoint(point int) *MetricQueryRequest

func (*MetricQueryRequest) Match

func (req *MetricQueryRequest) Match(key, val string) *MetricQueryRequest

func (*MetricQueryRequest) SetDiagram

func (req *MetricQueryRequest) SetDiagram(diagram string) *MetricQueryRequest

func (*MetricQueryRequest) Sort

func (req *MetricQueryRequest) Sort(field string) *MetricQueryRequest

func (*MetricQueryRequest) StartFrom

func (req *MetricQueryRequest) StartFrom(start time.Time) *MetricQueryRequest

type MetricQueryResponse

type MetricQueryResponse struct {
	StatusCode int
	Body       []byte
}

func (*MetricQueryResponse) ReturnAsPoint

func (resp *MetricQueryResponse) ReturnAsPoint() (out *Point, err error)

返回单值数据

func (*MetricQueryResponse) ReturnAsSeries

func (resp *MetricQueryResponse) ReturnAsSeries() (out *Series, err error)

返回多值时序数据

type Point

type Point struct {
	// Title string
	Name string
	Data []*PointData
}

单点数据,对应API: {{scope}}?...

type PointData

type PointData struct {
	Name      string      `mapstructure:"name"`
	AggMethod string      `mapstructure:"agg"`
	Data      interface{} `mapstructure:"data"`
}

type RangeCondition

type RangeCondition struct {
	Name   string
	Ranges []struct {
		From int
		To   int
	}

	Split     int
	RangeSize float64
}

type Series

type Series struct {
	Name       string
	Data       []*SeriesData
	TimeSeries []int // 毫秒
}

时序数据, 对应API:{{scope}}/histogram?...

type SeriesData

type SeriesData struct {
	Name      string    `mapstructure:"name"`
	AggMethod string    `mapstructure:"agg"`
	Data      []float64 `mapstructure:"data"`
	Tag       string    `mapstructure:"tag"`
}

type ServerError

type ServerError struct {
	// contains filtered or unexported fields
}

func (ServerError) Error

func (e ServerError) Error() string

type TimeAlignCondition

type TimeAlignCondition string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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