Documentation ¶
Index ¶
- func NewServerError(body []byte) error
- type FieldCondition
- type FilterCondition
- type FuncCondition
- type GroupCondition
- type MetricQuery
- type MetricQueryRequest
- func (req *MetricQueryRequest) Align(align TimeAlignCondition) *MetricQueryRequest
- func (req *MetricQueryRequest) Apply(funcName, field string) *MetricQueryRequest
- func (req *MetricQueryRequest) ConstructParam() *url.Values
- func (req *MetricQueryRequest) EndWith(end time.Time) *MetricQueryRequest
- func (req *MetricQueryRequest) Field(key string) *FieldCondition
- func (req *MetricQueryRequest) Filter(key, val string) *MetricQueryRequest
- func (req *MetricQueryRequest) FormatAs(format string) *MetricQueryRequest
- func (req *MetricQueryRequest) GroupBy(groups []string) *MetricQueryRequest
- func (req *MetricQueryRequest) In(key string, values []string) *MetricQueryRequest
- func (req *MetricQueryRequest) LimitGroup(limit int) *MetricQueryRequest
- func (req *MetricQueryRequest) LimitPoint(point int) *MetricQueryRequest
- func (req *MetricQueryRequest) Match(key, val string) *MetricQueryRequest
- func (req *MetricQueryRequest) SetDiagram(diagram string) *MetricQueryRequest
- func (req *MetricQueryRequest) Sort(field string) *MetricQueryRequest
- func (req *MetricQueryRequest) StartFrom(start time.Time) *MetricQueryRequest
- type MetricQueryResponse
- type Point
- type PointData
- type RangeCondition
- type Series
- type SeriesData
- type ServerError
- type TimeAlignCondition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServerError ¶
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 (req *MetricQueryRequest) Align(align TimeAlignCondition) *MetricQueryRequest
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 ¶
func (*MetricQueryResponse) ReturnAsPoint ¶
func (resp *MetricQueryResponse) ReturnAsPoint() (out *Point, err error)
返回单值数据
func (*MetricQueryResponse) ReturnAsSeries ¶
func (resp *MetricQueryResponse) ReturnAsSeries() (out *Series, err error)
返回多值时序数据
type RangeCondition ¶
type Series ¶
type Series struct { Name string Data []*SeriesData TimeSeries []int // 毫秒 }
时序数据, 对应API:{{scope}}/histogram?...
type SeriesData ¶
type ServerError ¶
type ServerError struct {
// contains filtered or unexported fields
}
func (ServerError) Error ¶
func (e ServerError) Error() string
type TimeAlignCondition ¶
type TimeAlignCondition string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.