drivers

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionKeyCPURatio     = "cpu_ratio"
	ConditionKeyMemRatio     = "mem_ratio"
	ConditionKeyGoroutineNum = "goroutine_num"

	ConditionCompareTypeThreshold = "threshold"
	ConditionCompareTypeWindow    = "windows"

	ConditionOpGt = ">" //only support gt

)
View Source
const (
	RecordTypeContinuous  = "continuous"
	RecordTypeTask        = "task" // alias 'timed', 'task' for forward compatibility
	RecordTypeConditional = "conditional"
)
View Source
const (
	Seconds60                = 60
	ContinuousPeriodTime     = time.Second * Seconds60 // continuous period
	ConditionalCheckInterval = time.Second * Seconds60 // time interval the conditions are checked
)
View Source
const (
	TimedPeriodSec  = 10
	TimedPeriodTime = time.Second * TimedPeriodSec
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionalDriver

type ConditionalDriver struct {
	// contains filtered or unexported fields
}

func (*ConditionalDriver) Handle

func (d *ConditionalDriver) Handle(ps []*settings_models.Profile)

func (*ConditionalDriver) Name

func (d *ConditionalDriver) Name() string

func (*ConditionalDriver) Start

func (d *ConditionalDriver) Start()

func (*ConditionalDriver) Stop

func (d *ConditionalDriver) Stop()

type ContinuousDriver

type ContinuousDriver struct {
	// contains filtered or unexported fields
}

func (*ContinuousDriver) Handle

func (d *ContinuousDriver) Handle(ps []*settings_models.Profile)

func (*ContinuousDriver) Name

func (d *ContinuousDriver) Name() string

func (*ContinuousDriver) Start

func (d *ContinuousDriver) Start()

func (*ContinuousDriver) Stop

func (d *ContinuousDriver) Stop()

type Driver

type Driver interface {
	Name() string
	Handle([]*settings_models.Profile)
	Start()
	Stop()
}

func NewConditionalDriver

func NewConditionalDriver(taskChan chan *common.Task, monitor *res_monitor.Monitor, l logger.Logger) Driver

func NewContinuousDriver

func NewContinuousDriver(taskChan chan *common.Task, l logger.Logger) Driver

func NewTimedDriver

func NewTimedDriver(taskChan chan *common.Task, l logger.Logger) Driver

type TimedDriver

type TimedDriver struct {
	// contains filtered or unexported fields
}

func (*TimedDriver) Handle

func (d *TimedDriver) Handle(ps []*settings_models.Profile)

func (*TimedDriver) Name

func (d *TimedDriver) Name() string

func (*TimedDriver) Start

func (d *TimedDriver) Start()

func (*TimedDriver) Stop

func (d *TimedDriver) Stop()

Jump to

Keyboard shortcuts

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