detector

package
v0.0.0-...-b3661d0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMetricSeriesByPromResponse

func BuildMetricSeriesByPromResponse(series api.Series) []api.MetricValue

func GetLocation

func GetLocation() *time.Location

func RobustGetMetricValues

func RobustGetMetricValues(singleMetricValues map[string][]api.MetricValue, metricName string) []api.MetricValue

Types

type CommonQueryCall

type CommonQueryCall func(serviceName string) (api.PromResponse, error)

type DeployResource

type DeployResource struct {
	server.BaseResource
	Detector *Detector
}

func (DeployResource) Delete

func (r DeployResource) Delete(c *gin.Context)

Get godoc @Summary Delete docker task @Tags task @Accept json @Produce json @Param task_name query string false "Task Name" @Success 200 {string} "Success" @Router /api/escaler/v1/docker/deploy [delete]

func (DeployResource) Get

func (r DeployResource) Get(c *gin.Context)

Get godoc @Summary Get docker task info @Tags task @Accept json @Produce json @Param task_name query string false "Task Name" @Success 200 {object} meta.DetectTaskSpecResponse @Router /api/escaler/v1/docker/deploy [get]

func (DeployResource) Path

func (r DeployResource) Path() string

func (DeployResource) Post

func (r DeployResource) Post(c *gin.Context)

Post godoc @Summary Create alert policy object @Tags task @Accept json @Produce json @Param payload body meta.DockerDeployRequest true "request content" @Success 200 {string} "success" @Router /api/escaler/v1/deploy [post]

type DetectResultManager

type DetectResultManager struct {
	RedisClient *redis.RedisClient
}

func (*DetectResultManager) AppendAnomalyResult

func (t *DetectResultManager) AppendAnomalyResult(task meta.TaskSpec, result meta.AnomalyRecommendResult) error

func (*DetectResultManager) GetHistoricalAnomalyRecommendResult

func (t *DetectResultManager) GetHistoricalAnomalyRecommendResult(task meta.TaskSpec) []meta.AnomalyRecommendResult

type Detector

type Detector struct {
	Queue               *queue.InnerChanTaskQueue
	PermCli             PerformanceDetectorCli
	Client              resource.ClientInterface
	TaskMap             map[string]*meta.DetectTask
	DetectResultManager *DetectResultManager

	MulticlusterScaler MulticlusterScaler
	// contains filtered or unexported fields
}

func NewDetector

func NewDetector(ch chan meta.TaskSpecInterface) *Detector

func NewK8sDetector

func NewK8sDetector(ch chan meta.TaskSpecInterface, multiclusterScaler MulticlusterScaler) *Detector

func (*Detector) AnomalyDetect

func (d *Detector) AnomalyDetect(spec meta.TaskSpecInterface) (bool, error)

func (*Detector) DeleteTask

func (d *Detector) DeleteTask(taskName string)

func (*Detector) DeployTask

func (d *Detector) DeployTask(task meta.TaskSpec)

func (*Detector) DetectOnce

func (d *Detector) DetectOnce()

DetectOnce Detect anomaly from remote Sync Status to MulticlusterEnovaServing

func (*Detector) DetectOneTaskSpec

func (d *Detector) DetectOneTaskSpec(taskName string, taskSpec meta.TaskSpecInterface)

DetectOneTaskSpec first Check anomaly detection, then get anomaly recovery

func (*Detector) IsTaskExisted

func (d *Detector) IsTaskExisted(task meta.TaskSpecInterface) bool

func (*Detector) IsTaskRunning

func (d *Detector) IsTaskRunning(taskName string, task meta.TaskSpecInterface) bool

IsTaskRunning TODO: add GetTaskMap

func (*Detector) RegisterTask

func (d *Detector) RegisterTask(task meta.TaskSpec)

RegisterTask Register Task to taskmap

func (*Detector) RunDetector

func (d *Detector) RunDetector()

func (*Detector) SendScaleTask

func (d *Detector) SendScaleTask(task meta.TaskSpecInterface)

func (*Detector) Stop

func (d *Detector) Stop()

func (*Detector) UpdateServingInitialBackendConfigByRemote

func (d *Detector) UpdateServingInitialBackendConfigByRemote(spec meta.TaskSpecInterface) error

UpdateServingngInitialBackendConfigByRemote Get Remote recommending backendCOnfig When first deploy,

func (*Detector) UpdateTaskSpec

func (d *Detector) UpdateTaskSpec(task meta.TaskSpecInterface, resp api.ConfigRecommendResult)

UpdateTaskSpec

type DetectorServer

type DetectorServer struct {
	Detector *Detector
	// contains filtered or unexported fields
}

func NewDetectorServer

func NewDetectorServer(ch chan meta.TaskSpecInterface, multiclusterScaler MulticlusterScaler) *DetectorServer

func (*DetectorServer) GetEngine

func (d *DetectorServer) GetEngine() *gin.Engine

func (*DetectorServer) InitServer

func (d *DetectorServer) InitServer()

func (*DetectorServer) Run

func (d *DetectorServer) Run()

func (*DetectorServer) RunInWaitGroup

func (d *DetectorServer) RunInWaitGroup(wg *sync.WaitGroup)

func (*DetectorServer) RunServer

func (d *DetectorServer) RunServer()

type DockerDeployRequest

type DockerDeployRequest struct {
	Name        string           `json:"name"`
	Model       string           `json:"model"`
	ModelConfig meta.ModelConfig `json:"model_config"`
}

type MulticlusterScaler

type MulticlusterScaler interface {
	Scale(k8s.Workload) error
}

type PerformanceDetectorCli

type PerformanceDetectorCli struct {
}

func (*PerformanceDetectorCli) AsyncQuery

func (p *PerformanceDetectorCli) AsyncQuery(
	resultCache map[string]map[string][]api.MetricValue, wg *sync.WaitGroup, resultLock *sync.Mutex, queryCall CommonQueryCall, serviceName, resultKey string)

func (*PerformanceDetectorCli) CommonMetricQuery

func (p *PerformanceDetectorCli) CommonMetricQuery(query string, start string, end string, step string) (api.PromResponse, error)

func (*PerformanceDetectorCli) GetActiveRequestMetric

func (p *PerformanceDetectorCli) GetActiveRequestMetric(serviceName string) (api.PromResponse, error)

func (*PerformanceDetectorCli) GetGpuKVCacheUsageMetric

func (p *PerformanceDetectorCli) GetGpuKVCacheUsageMetric(serviceName string) (api.PromResponse, error)

func (*PerformanceDetectorCli) GetPendingRequestMetric

func (p *PerformanceDetectorCli) GetPendingRequestMetric(serviceName string) (api.PromResponse, error)

func (*PerformanceDetectorCli) GetRunningRequestMetric

func (p *PerformanceDetectorCli) GetRunningRequestMetric(serviceName string) (api.PromResponse, error)

func (*PerformanceDetectorCli) GetServerNewRequestsMetric

func (p *PerformanceDetectorCli) GetServerNewRequestsMetric(serviceName string) (api.PromResponse, error)

func (*PerformanceDetectorCli) GetServerSuccessRequestsMetric

func (p *PerformanceDetectorCli) GetServerSuccessRequestsMetric(serviceName string) (api.PromResponse, error)

func (*PerformanceDetectorCli) GetThroughputTokensMetric

func (p *PerformanceDetectorCli) GetThroughputTokensMetric()

func (*PerformanceDetectorCli) GetVllmCurrentMetricParams

func (p *PerformanceDetectorCli) GetVllmCurrentMetricParams(spec meta.TaskSpecInterface) (api.AnomalyRecoverRequest, error)

type TaskDetectResource

type TaskDetectResource struct {
	server.BaseResource
	Detector *Detector
}

func (TaskDetectResource) Get

func (r TaskDetectResource) Get(c *gin.Context)

Get godoc @Summary Get task detect history list @Tags task @Accept json @Produce json @Param task_name query string false "Task Name" @Success 200 {object} meta.TaskDetectHistoryResponse @Router /api/escaler/v1/task/detect/history [get]

func (TaskDetectResource) Path

func (r TaskDetectResource) Path() string

Jump to

Keyboard shortcuts

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