core

package
v0.0.0-...-f46da47 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootConfig = &Config{
	MemTrace: MemTraceConfig{
		TraceCount:        1000000000,
		MaxRthTime:        100000,
		ConcurrentMax:     int(math.Min(math.Max(1, float64(runtime.NumCPU())/4), 4)),
		RthCalculatorType: RthCalculatorTypeReservoir,
		ReservoirSize:     100000,
		Sampler:           MemTraceSamplerPerf,
		PinConfig: PinConfig{
			PinPath:        "/home/wjx/bin/pin",
			PinToolPath:    "/home/wjx/Workspace/pin-3.17/source/tools/MemTrace2/obj-intel64/MemTrace2.so",
			BufferSize:     10000,
			WriteThreshold: 20000,
		},
		PerfRecordConfig: PerfRecordConfig{
			SwitchOutput:  "10M",
			OverflowCount: 5,
			PerfExecPath:  "/home/wjx/linux-5.4.0/tools/perf",
		},
	},
	PerfStat: PerfStatConfig{
		SampleTime:        30 * time.Second,
		MicroArchitecture: MicroArchitectureNameSkyLake,
	},
	Algorithm: AlgorithmConfig{
		Classify: ClassifyConfig{
			MPKIVeryHigh:               10,
			MPKIHigh:                   5,
			HPKIVeryHigh:               10,
			HPKIVeryLow:                0.5,
			IPCVeryLow:                 0.6,
			IPCLow:                     1.3,
			NonCriticalAPKI:            1,
			NoChangeThreshold:          0.1,
			SignificantChangeThreshold: 0.3,
			APKILow:                    1,
		},
		DCAPS: DCAPSConfig{
			MaxIteration:                        200,
			InitialStep:                         10000,
			MinStep:                             100,
			StepReductionRatio:                  0.8,
			InitialTemperature:                  10000,
			TemperatureMin:                      100,
			TemperatureReductionRatio:           0.8,
			K:                                   1,
			ProbabilityChangeScheme:             0.2,
			AggregateChangeOfOccupancyThreshold: 100,
		},
	},
	Manager: ManagerConfig{
		AllocCoolDown:               60 * time.Second,
		AllocSquash:                 50 * time.Millisecond,
		ChangeProcessCountThreshold: 100,
		TargetPrograms: []string{"blackscholes", "bodytrack", "canneal", "dedup", "facesim", "ferret", "fluidanimate", "freqmine",
			"rtview", "streamcluster", "swaptions", "vips", "x264"},
		ClassifyAfter: 5 * time.Second,
	},
	Debug: DebugConfig{
		IgnorePqosError: false,
	},
}

Functions

This section is empty.

Types

type AlgorithmConfig

type AlgorithmConfig struct {
	Classify ClassifyConfig
	DCAPS    DCAPSConfig
}

type ClassifyConfig

type ClassifyConfig struct {
	MPKIVeryHigh               float64
	MPKIHigh                   float64
	HPKIVeryHigh               float64
	HPKIVeryLow                float64
	IPCVeryLow                 float64
	IPCLow                     float64
	NonCriticalAPKI            float64
	NoChangeThreshold          float64
	SignificantChangeThreshold float64
	APKILow                    float64
}

type Cloneable

type Cloneable interface {
	Clone() Cloneable
}

type Config

type Config struct {
	MemTrace   MemTraceConfig
	PerfStat   PerfStatConfig
	Algorithm  AlgorithmConfig
	Kubernetes KubernetesConfig
	Manager    ManagerConfig
	Debug      DebugConfig
}

顶层公共Config

func (*Config) Check

func (config *Config) Check() error

func (*Config) String

func (config *Config) String() string

type DCAPSConfig

type DCAPSConfig struct {
	MaxIteration                        int
	InitialStep                         float64
	MinStep                             float64
	StepReductionRatio                  float64
	InitialTemperature                  float64
	TemperatureMin                      float64
	TemperatureReductionRatio           float64
	K                                   float64 // 计算是否更改计划的概率公式常数。值越大,概率越大
	ProbabilityChangeScheme             float64
	AggregateChangeOfOccupancyThreshold int
}

type DebugConfig

type DebugConfig struct {
	IgnorePqosError bool // 即便PQOS设置失败,也不会返回错误。鉴于开发机没有CAT功能,打开此选项用于本地调试。
}

type KubernetesConfig

type KubernetesConfig struct {
	TokenFile string
	CAFile    string
	Insecure  bool
	Host      string
}

type ManagerConfig

type ManagerConfig struct {
	AllocCoolDown               time.Duration // 再分配的冷却时间,避免频繁分配
	AllocSquash                 time.Duration // 在这个时间段内,多个分配请求合并到一次完成
	ChangeProcessCountThreshold int           // 多个进程组更新时,更新的进程的数量达到这个数字时才进行再分配
	TargetPrograms              []string      // 当使用ProcessWatcher时,监控的目标程序
	ClassifyAfter               time.Duration // 跳过应用启动的的初始化时间
}

type MemTraceConfig

type MemTraceConfig struct {
	TraceCount        int
	MaxRthTime        int
	ConcurrentMax     int
	RthCalculatorType RthCalculatorType
	ReservoirSize     int
	Sampler           MemTraceSampler
	PinConfig         PinConfig
	PerfRecordConfig  PerfRecordConfig
}

type MemTraceSampler

type MemTraceSampler string
var (
	MemTraceSamplerPerf MemTraceSampler = "perf"
	MemTraceSamplerPin  MemTraceSampler = "pin"
)

type MicroArchitectureName

type MicroArchitectureName string
var (
	MicroArchitectureNameSkyLake     MicroArchitectureName = "SkyLake"
	MicroArchitectureNameCascadeLake MicroArchitectureName = "CascadeLake"
)

type PerfRecordConfig

type PerfRecordConfig struct {
	SwitchOutput  string
	OverflowCount int
	PerfExecPath  string
}

type PerfStatConfig

type PerfStatConfig struct {
	MicroArchitecture MicroArchitectureName
	SampleTime        time.Duration
}

type PinConfig

type PinConfig struct {
	PinPath        string
	PinToolPath    string
	BufferSize     int
	WriteThreshold int
}

type ProcessGroup

type ProcessGroup struct {
	Id  string
	Pid []int
}

func (*ProcessGroup) Clone

func (p *ProcessGroup) Clone() Cloneable

type RthCalculatorType

type RthCalculatorType string
var (
	RthCalculatorTypeReservoir RthCalculatorType = "reservoir"
	RthCalculatorTypeFull      RthCalculatorType = "full"
)

Jump to

Keyboard shortcuts

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