Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientContext ¶
type ClientContext struct {
IP string `json:"ip"`
}
type Dispatcher ¶
type Endpoint ¶
type Endpoint struct { IP string `json:"ip"` Port string `json:"port"` ActiveSorce float64 `json:"-"` StaticSorce float64 `json:"-"` Stats *Stat `json:"-"` // contains filtered or unexported fields }
func Dispatch ¶
func Dispatch(ctx *IpConfContext) []*Endpoint
func NewEndport ¶
func (*Endpoint) CalculateScore ¶
func (ed *Endpoint) CalculateScore(ctx *IpConfContext)
func (*Endpoint) UpdateStat ¶
type IpConfContext ¶
type IpConfContext struct { Ctx *context.Context AppCtx *app.RequestContext ClientCtx *ClientContext }
func BuildIpConfContext ¶
func BuildIpConfContext(c *context.Context, ctx *app.RequestContext) *IpConfContext
构建ipconf的conetxt
type Stat ¶
type Stat struct { MessageBytes float64 // 活跃分 gateway 每秒钟收发字节数的 剩余值 ConnectNum float64 // 静态分 gateway 总体持有的长连接数量的 剩余值 }
数值代表的是,此endpoint对应的机器其自身剩余的资源指标
func (*Stat) CalculateActiveSorce ¶
func (*Stat) CalculateStaticSorce ¶
Click to show internal directories.
Click to hide internal directories.