cpi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRecord

func AddRecord(record CPIRecord)

AddRecord adds record to default CPIManager

func InitManager

func InitManager(cfg types.CPIManagerConfig) error

InitManager initializes default CPIManager

Types

type Antagonist

type Antagonist struct {
	TaskMeta
	// contains filtered or unexported fields
}

Antagonist describe antagonist tasks information

type CPIManager

type CPIManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

CPIManager compares aggregated CPI data from prometheus and local CPI data to detect outliers and antagonists

func (*CPIManager) AddRecord

func (m *CPIManager) AddRecord(record CPIRecord)

AddRecord caches record in CPIManager

type CPIRecord

type CPIRecord struct {
	TaskMeta
	CPI       float64
	CPUUsage  float64
	Timestamp time.Time
}

CPIRecord contains cpi and cpu data for a task

type JobSpec

type JobSpec struct {
	JobName   string
	CPIMean   float64
	CPIStdDev float64
	ExpiredAt time.Time
}

JobSpec contains aggregated cpi data for a job

func (JobSpec) String

func (s JobSpec) String() string

String prints JobSpec

type TaskMeta

type TaskMeta struct {
	JobName  string
	TaskName string
}

TaskMeta describes tasks

func (TaskMeta) String

func (t TaskMeta) String() string

String prints TaskMeta

Jump to

Keyboard shortcuts

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