monitor

package
v1.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMonitorProxy

type CreateMonitorProxy struct {
}

type IMonitorService

type IMonitorService interface {
	// Get 获取监控配置
	Get(ctx context.Context, id string) (*Monitor, error)
	// MapByCluster 获取监控配置
	MapByCluster(ctx context.Context, clusterIds ...string) (map[string]*Monitor, error)
	GetByCluster(ctx context.Context, clusterId string) (*Monitor, error)
	// Save 保存监控配置
	Save(ctx context.Context, monitor *SaveMonitor) error
}

type IMonitorSourceDriver

type IMonitorSourceDriver interface {
	CheckInput(config []byte) ([]byte, error)
}

IMonitorSourceDriver 监控数据源驱动

type IMonitorSourceManager

type IMonitorSourceManager interface {
	//driver.IDriverManager[IMonitorSourceDriver]
	List() []string
}

type IMonitorStatisticsCache

type IMonitorStatisticsCache interface {
	GetStatisticsCache(ctx context.Context, partitionId string, start, end time.Time, groupBy string, wheres []MonWhereItem, limit int) (map[string]MonCommonData, error)
	SetStatisticsCache(ctx context.Context, partitionId string, start, end time.Time, groupBy string, wheres []MonWhereItem, limit int, values map[string]MonCommonData) error

	GetTrendCache(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem) (*MonInvokeCountTrend, error)
	SetTrendCache(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem, value *MonInvokeCountTrend) error

	GetMessageTrend(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem) (*MonMessageTrend, error)
	SetMessageTrend(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem, val *MonMessageTrend) error
}

type MonCommonData

type MonCommonData struct {
	ID             string  `json:"id"`
	RequestTotal   int64   `json:"request_total"`   //请求总数
	RequestSuccess int64   `json:"request_success"` //请求成功数
	RequestRate    float64 `json:"request_rate"`    //请求成功率
	ProxyTotal     int64   `json:"proxy_total"`     //转发总数
	ProxySuccess   int64   `json:"proxy_success"`   //转发成功数
	ProxyRate      float64 `json:"proxy_rate"`      //转发成功率
	StatusFail     int64   `json:"status_fail"`     //失败状态数
	AvgResp        float64 `json:"avg_resp"`        //平均响应时间
	MaxResp        int64   `json:"max_resp"`        //最大响应时间
	MinResp        int64   `json:"min_resp"`        //最小响应时间
	AvgTraffic     float64 `json:"avg_traffic"`     //平均流量
	MaxTraffic     int64   `json:"max_traffic"`     //最大流量
	MinTraffic     int64   `json:"min_traffic"`     //最小流量
}

MonCommonData 通用字段

type MonCommonInput

type MonCommonInput struct {
	StartTime    int64
	EndTime      int64
	PartitionId  string
	Path         string
	Clusters     []string
	Ip           string
	Keyword      string
	ServiceName  string
	AppId        string
	ApiId        string
	ServiceNames []string
	AppIds       []string
	ApiIds       []string
	PageNum      int
	PageSize     int
	Sort         MonCommonSort
}

type MonCommonSort

type MonCommonSort struct {
	Key MonSortType
	Val bool
}

type MonCommonStatistics

type MonCommonStatistics struct {
	ApiId       string //apiID
	ApiName     string //api名称
	ServiceID   string //上游服务ID
	ServiceName string //上游服务名称
	AppName     string //应用名称
	AppId       string //应用ID
	Path        string //路径
	ProxyPath   string //转发路径
	Ip          string //IP
	Node        string //目标节点
	IsRed       bool   //是否标红
	MonCommonData
}

MonCommonStatistics 调用统计

type MonInvokeCountTrend

type MonInvokeCountTrend struct {
	Date         []time.Time `json:"date"`
	Status5XX    []int64     `json:"status_5_xx"`
	Status4XX    []int64     `json:"status_4_xx"`
	ProxyRate    []float64   `json:"proxy_rate"`
	ProxyTotal   []int64     `json:"proxy_total"`
	RequestRate  []float64   `json:"request_rate"`
	RequestTotal []int64     `json:"request_total"`
}

type MonMessageTrend

type MonMessageTrend struct {
	Dates       []time.Time `json:"dates"`
	ReqMessage  []float64   `json:"req_message"`
	RespMessage []float64   `json:"resp_message"`
}

type MonPirMapInfo

type MonPirMapInfo struct {
	RequestTotal     int `json:"request_total"`   //请求总数
	RequestSuccess   int `json:"request_success"` //请求成功数
	RequestFail      int `json:"request_fail"`    //请求失败数
	RequestStatus5XX int `json:"request_status_5_xx"`
	RequestStatus4XX int `json:"request_status_4_xx"`
	ProxyTotal       int `json:"proxy_total"`   //转发总数
	ProxySuccess     int `json:"proxy_success"` //转发成功数
	ProxyFail        int `json:"proxy_fail"`    //转发失败数
	ProxyStatus5XX   int `json:"proxy_status_5_xx"`
	ProxyStatus4XX   int `json:"proxy_status_4_xx"`
}

type MonProxyData

type MonProxyData struct {
	ProxyTotal   int64   `json:"proxy_total"`   //转发总数
	ProxySuccess int64   `json:"proxy_success"` //转发成功数
	ProxyRate    float64 `json:"proxy_rate"`    //转发成功率
	StatusFail   int64   `json:"status_fail"`   //失败状态数
	AvgResp      float64 `json:"avg_resp"`      //平均响应时间
	MaxResp      int64   `json:"max_resp"`      //最大响应时间
	MinResp      int64   `json:"min_resp"`      //最小响应时间
	AvgTraffic   float64 `json:"avg_traffic"`   //平均流量
	MaxTraffic   int64   `json:"max_traffic"`   //最大流量
	MinTraffic   int64   `json:"min_traffic"`   //最小流量
}

type MonSortBy

type MonSortBy struct {
	Key  string
	Desc bool
}

type MonSortType

type MonSortType string

type MonStatisticsValue

type MonStatisticsValue struct {
	MonCommonData
}

type MonTrendFilter

type MonTrendFilter struct {
	Name string
	MonWhereItem
}

type MonTrendValues

type MonTrendValues struct {
	Data   []string
	Names  []string
	Values [][]interface{}
}

type MonWhereItem

type MonWhereItem struct {
	Key       string
	Operation string // 表达式,默认为 =,多个为 in,可以用其他
	Values    []string
}

type Monitor

type Monitor struct {
	ID       string
	Cluster  string
	Driver   string
	Config   string
	Creator  string
	Updater  string
	CreateAt time.Time
	UpdateAt time.Time
}

type SaveMonitor

type SaveMonitor struct {
	Cluster string
	Driver  string
	Config  string
}

type Summary

type Summary struct {
	Total     int64 `json:"total"`
	Success   int64 `json:"success"`
	Fail      int64 `json:"fail"`
	Status4Xx int64 `json:"status_4xx"`
	Status5Xx int64 `json:"status_5xx"`
}

type UpdateMonitorProxy

type UpdateMonitorProxy struct {
}

Jump to

Keyboard shortcuts

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