flux

package
v1.9.3-beta Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateFn

type AggregateFn string
const (
	SumFn AggregateFn = "sum"
	MaxFn AggregateFn = "max"
	MinFn AggregateFn = "min"
	AvgFn AggregateFn = "mean"
)

type BucketConf

type BucketConf struct {
	BucketName string `yaml:"bucket_name"`
	Retention  int64  `yaml:"retention"`
}

func GetBucketConfigList

func GetBucketConfigList() []*BucketConf

type FluxStatistics

type FluxStatistics struct {
	Total         int64 `json:"total"`           //总数
	Success       int64 `json:"success"`         //成功数
	S2xx          int64 `json:"s2xx"`            //2xx
	ProxyTotal    int64 `json:"p_total"`         //转发总数
	ProxySuccess  int64 `json:"p_success"`       //转发成功数
	TotalTiming   int64 `json:"timing"`          //平均响应时间
	MaxTiming     int64 `json:"timing_max"`      //最大响应时间
	MinTiming     int64 `json:"timing_min"`      //最小响应时间
	TotalRequest  int64 `json:"request"`         //总请求流量
	RequestMax    int64 `json:"request_max"`     //最大流量
	RequestMin    int64 `json:"request_min"`     //最小流量
	TotalResponse int64 `json:"response"`        //总请求流量
	ResponseMax   int64 `json:"response_max"`    //最大流量
	ResponseMin   int64 `json:"response_min"`    //最小流量
	TotalToken    int64 `json:"total_token"`     //总token流量
	TokenMax      int64 `json:"total_token_max"` //最大token流量
	TokenMin      int64 `json:"total_token_min"` //最小token流量
}

FluxStatistics flux统计通用字段

type FluxWarnStatistics

type FluxWarnStatistics struct {
	Total         int64 `json:"total"`   //总数
	Success       int64 `json:"success"` //成功数
	S2xx          int64 `json:"s2xx"`
	S4xx          int64 `json:"s4xx"`
	S5xx          int64 `json:"s5xx"`
	ProxyTotal    int64 `json:"p_total"`   //转发总数
	ProxySuccess  int64 `json:"p_success"` //转发成功数
	ProxyS4xx     int64 `json:"p_s4xx"`
	ProxyS5xx     int64 `json:"p_s5xx"`
	TotalTiming   int64 `json:"timing"`   //平均响应时间
	TotalRequest  int64 `json:"request"`  //总请求流量
	TotalResponse int64 `json:"response"` //总响应流量
}

FluxWarnStatistics flux统计告警通用字段

type IFluxQuery

type IFluxQuery interface {
	CommonStatistics(ctx context.Context, queryApi api.QueryAPI, start, end time.Time, bucket, groupBy, filters string, statisticsConf []*StatisticsFilterConf, limit int) (map[string]*FluxStatistics, error)
	CommonProxyStatistics(ctx context.Context, queryApi api.QueryAPI, start, end time.Time, bucket, groupBy, filters string, statisticsConf []*StatisticsFilterConf, limit int) (map[string]*FluxStatistics, error)
	CommonTendency(ctx context.Context, queryApi api.QueryAPI, start, end time.Time, bucket, table, filters string, dataFields []string, every, windowOffset string, fn AggregateFn) ([]time.Time, map[string][]int64, error)
	CommonTendencyTag(ctx context.Context, queryApi api.QueryAPI, start, end time.Time, bucket, table, filters, every, offset, tag string) (int64, map[time.Time]int64, error)
	// CommonQueryOnce 查询只返回一条结果
	CommonQueryOnce(ctx context.Context, queryApi api.QueryAPI, start, end time.Time, bucket, filters string, fieldsConf *StatisticsFilterConf) (map[string]interface{}, error)
	CommonWarnStatistics(ctx context.Context, queryApi api.QueryAPI, start, end time.Time, bucket, groupBy, filters string, statisticsConf *StatisticsFilterConf) (map[string]*FluxWarnStatistics, error)
}

type StatisticsFilterConf

type StatisticsFilterConf struct {
	Measurement string
	AggregateFn string
	Fields      []string
}

StatisticsFilterConf 统计表过滤_field的配置

type TaskConf

type TaskConf struct {
	TaskName string `yaml:"task_name"`
	Cron     string `yaml:"cron"`
	Offset   string `yaml:"offset"`
	Flux     string `yaml:"flux"`
}

func GetTaskConfigList

func GetTaskConfigList() []*TaskConf

Jump to

Keyboard shortcuts

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