Documentation
¶
Index ¶
- Constants
- Variables
- func ClearRuleOfResource(res string) error
- func ClearRules() error
- func IsValidRule(r *Rule) error
- func LoadRuleOfResource(res string, rule *Rule) (bool, error)
- func LoadRules(rules []*Rule) (bool, error)
- func LogRuleUpdate(rules map[string]*Rule)
- type MetricStatSlot
- type RecoveryCheckFunc
- type Recycler
- type Retryer
- type Rule
- type Slot
Constants ¶
const (
RuleCheckSlotOrder = 6000
)
const (
StatSlotOrder = 6000
)
Variables ¶
var (
DefaultMetricStatSlot = &MetricStatSlot{}
)
var (
DefaultSlot = &Slot{}
)
Functions ¶
func ClearRuleOfResource ¶
ClearRuleOfResource clears resource level rule in outlier ejection module.
func IsValidRule ¶
func LoadRuleOfResource ¶
LoadRuleOfResource loads the given resource's outlier ejection rule to the rule manager, while previous resource's rule will be replaced. the first returned value indicates whether do real load operation, if the rule is the same with previous resource's rule, return false
func LoadRules ¶
LoadRules replaces old outlier ejection rules with the given rules.
return value:
bool: was designed to indicate whether the internal map has been changed error: was designed to indicate whether occurs the error.
func LogRuleUpdate ¶
Types ¶
type MetricStatSlot ¶
type MetricStatSlot struct { }
MetricStatSlot records metrics for outlier ejection on invocation completed. MetricStatSlot must be filled into slot chain if outlier ejection is alive.
func (*MetricStatSlot) OnCompleted ¶
func (c *MetricStatSlot) OnCompleted(ctx *base.EntryContext)
func (*MetricStatSlot) OnEntryBlocked ¶
func (c *MetricStatSlot) OnEntryBlocked(_ *base.EntryContext, _ *base.BlockError)
func (*MetricStatSlot) OnEntryPassed ¶
func (c *MetricStatSlot) OnEntryPassed(_ *base.EntryContext)
func (*MetricStatSlot) Order ¶
func (s *MetricStatSlot) Order() uint32
type RecoveryCheckFunc ¶
type Recycler ¶
type Recycler struct {
// contains filtered or unexported fields
}
Recycler recycles node instance that have been invalidated for a long time
type Retryer ¶
type Retryer struct {
// contains filtered or unexported fields
}
Each service should have its own Retryer to proactively retry in case of node failure.
type Rule ¶
type Rule struct { *circuitbreaker.Rule // Whether to enable active detection mode for recovery. // Enabling active detection mode will disable passive detection. EnableActiveRecovery bool // An upper limit on the percentage of nodes to be excluded from the // service's load balancing pool. MaxEjectionPercent float64 // The initial value of the time interval (in ms) to resume detection. RecoveryIntervalMs uint32 // The time interval (in seconds) for node recycling。 RecycleIntervalS uint32 // Maximum number of recovery attempts allowed during recovery detection. MaxRecoveryAttempts uint32 // RecoveryCheckFunc is used to determine whether a node is healthy in // the active recovery mode. RecoveryCheckFunc RecoveryCheckFunc }
Rule encompasses the fields of outlier ejection rule.
func GetRules ¶
func GetRules() []Rule
GetRules returns all the rules based on copy. It doesn't take effect for outlier ejection module if user changes the rule. GetRules need to compete outlier ejection module's global lock and the high performance losses of copy,
reduce or do not call GetRules if possible