Documentation
¶
Index ¶
- Constants
- type CPUThreshold
- type CandidatePool
- type ConsulClient
- type ConsulResolver
- func (r *ConsulResolver) GetZoneNodes(zone string) []*ServiceNode
- func (r *ConsulResolver) SelectNode() *ServiceNode
- func (r *ConsulResolver) SetLogger(logger util.Logger)
- func (r *ConsulResolver) SetWatcher(watcherLogger util.Logger)
- func (r *ConsulResolver) SetZone(zone string)
- func (r *ConsulResolver) Start() error
- func (r *ConsulResolver) Stop()
- type ConsulResolverBuilder
- type ConsulResolverMetric
- type InstanceFactor
- type InstanceMetaInfo
- type OnlineLab
- type ServiceNode
- type ServiceNodes
- type ServiceZone
- type ZoneCPUUtilizationRatio
Constants ¶
View Source
const ( BALANCEFACTOR_MAX_LOCAL = 3000 BALANCEFACTOR_MIN_LOCAL = 200 BALANCEFACTOR_MAX_CROSS = 1000 BALANCEFACTOR_MIN_CROSS = 1 BALANCEFACTOR_START_CROSS = 50 BALANCEFACTOR_CROSS_RATE = 0.1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUThreshold ¶
type CPUThreshold struct {
CThreshold float64 `json:"cpuThreshold"`
}
type CandidatePool ¶
type CandidatePool struct { Nodes []*ServiceNode Factors []float64 Weights []float64 FactorSum float64 }
type ConsulClient ¶
type ConsulClient struct {
// contains filtered or unexported fields
}
func NewConsulClient ¶
func NewConsulClient(address string) (*ConsulClient, error)
func (*ConsulClient) GetServiceNodes ¶
func (c *ConsulClient) GetServiceNodes(service, tag string, passingOnly bool) ([]ServiceNode, error)
type ConsulResolver ¶
type ConsulResolver struct {
// contains filtered or unexported fields
}
func NewConsulResolver ¶
func (*ConsulResolver) GetZoneNodes ¶ added in v0.0.4
func (r *ConsulResolver) GetZoneNodes(zone string) []*ServiceNode
func (*ConsulResolver) SelectNode ¶
func (r *ConsulResolver) SelectNode() *ServiceNode
func (*ConsulResolver) SetLogger ¶
func (r *ConsulResolver) SetLogger(logger util.Logger)
func (*ConsulResolver) SetWatcher ¶ added in v0.0.7
func (r *ConsulResolver) SetWatcher(watcherLogger util.Logger)
func (*ConsulResolver) SetZone ¶
func (r *ConsulResolver) SetZone(zone string)
func (*ConsulResolver) Start ¶
func (r *ConsulResolver) Start() error
func (*ConsulResolver) Stop ¶
func (r *ConsulResolver) Stop()
type ConsulResolverBuilder ¶
type ConsulResolverBuilder struct { Cloud string Address string Service string CPUThresholdKey string ZoneCPUKey string InstanceFactorKey string OnlineLabKey string Interval time.Duration Timeout time.Duration }
func (*ConsulResolverBuilder) Build ¶
func (b *ConsulResolverBuilder) Build() (*ConsulResolver, error)
type ConsulResolverMetric ¶
type ConsulResolverMetric struct {
// contains filtered or unexported fields
}
type InstanceFactor ¶
type InstanceFactor struct { Updated int64 `json:"updated"` Date []InstanceMetaInfo `json:"data"` }
type InstanceMetaInfo ¶
type ServiceNode ¶
type ServiceNodes ¶ added in v0.1.7
type ServiceNodes struct { UpdateTime int64 Data []ServiceNode }
type ServiceZone ¶
type ServiceZone struct { Nodes []*ServiceNode Zone string WorkLoad float64 }
type ZoneCPUUtilizationRatio ¶
Click to show internal directories.
Click to hide internal directories.