system

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 13 Imported by: 32

Documentation

Index

Constants

View Source
const SlotName = "SystemAdaptiveSlot"

Variables

This section is empty.

Functions

func ClearRules

func ClearRules() error

ClearRules clear all the previous rules

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 (*SystemAdaptiveSlot) String

func (s *SystemAdaptiveSlot) String() string

type SystemRule

type SystemRule struct {
	ID uint64

	MetricType   MetricType
	TriggerCount float64
	Strategy     AdaptiveStrategy
}

func GetRules

func GetRules() []*SystemRule

GetRules return all the rules

func (*SystemRule) ResourceName

func (r *SystemRule) ResourceName() string

func (*SystemRule) String

func (r *SystemRule) String() string

Jump to

Keyboard shortcuts

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