Documentation ¶
Index ¶
- Constants
- func ClearRules() error
- func CurrentCpuUsage() float64
- func CurrentLoad() float64
- func InitCollector(intervalMs uint32)
- func IsValidSystemRule(rule *SystemRule) error
- func LoadRules(rules []*SystemRule) (bool, error)
- type AdaptiveStrategy
- type MetricType
- type RuleMap
- type SystemAdaptiveSlot
- type SystemRule
Constants ¶
View Source
const SlotName = "SystemAdaptiveSlot"
Variables ¶
This section is empty.
Functions ¶
func CurrentCpuUsage ¶
func CurrentCpuUsage() float64
func CurrentLoad ¶
func CurrentLoad() float64
func InitCollector ¶
func InitCollector(intervalMs uint32)
func IsValidSystemRule ¶
func IsValidSystemRule(rule *SystemRule) error
IsValidSystemRule determine the system rule is valid or not
func LoadRules ¶
func LoadRules(rules []*SystemRule) (bool, error)
LoadRules loads given system rules to the rule manager, while all previous rules will be replaced.
Types ¶
type AdaptiveStrategy ¶
type AdaptiveStrategy int32
const ( NoAdaptive AdaptiveStrategy = -1 // 1 BBR AdaptiveStrategy = iota )
func (AdaptiveStrategy) String ¶
func (t AdaptiveStrategy) String() string
type MetricType ¶
type MetricType uint32
const ( // Load represents system load1 in Linux/Unix. Load MetricType = iota // AvgRT represents the average response time of all inbound requests. AvgRT // Concurrency represents the concurrency of all inbound requests. Concurrency InboundQPS CpuUsage // MetricTypeSize indicates the enum size of MetricType. MetricTypeSize )
func (MetricType) String ¶
func (t MetricType) String() string
type RuleMap ¶
type RuleMap map[MetricType][]*SystemRule
type SystemAdaptiveSlot ¶
type SystemAdaptiveSlot struct { }
func (*SystemAdaptiveSlot) Check ¶
func (s *SystemAdaptiveSlot) Check(ctx *base.EntryContext) *base.TokenResult
func (*SystemAdaptiveSlot) String ¶
func (s *SystemAdaptiveSlot) String() string
type SystemRule ¶
type SystemRule struct { ID uint64 MetricType MetricType TriggerCount float64 Strategy AdaptiveStrategy }
func (*SystemRule) ResourceName ¶
func (r *SystemRule) ResourceName() string
func (*SystemRule) String ¶
func (r *SystemRule) String() string
Click to show internal directories.
Click to hide internal directories.