api

package
v0.0.0-...-1c850f2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnovaAlgoClient *enovaAlgoClient
View Source
var PromClient *promClient

Functions

func GetEnovaAlgoClient

func GetEnovaAlgoClient() *enovaAlgoClient

func GetPromClient

func GetPromClient() *promClient

Types

type AnomalyDetectRequest

type AnomalyDetectRequest struct {
	Metrics        []Metrics      `json:"metrics"`
	Configurations Configurations `json:"configurations"`
}

type AnomalyDetectResponse

type AnomalyDetectResponse struct {
	IsAnomaly int `json:"is_anomaly"`
}

type AnomalyRecoverRequest

type AnomalyRecoverRequest struct {
	Metrics        []Metrics      `json:"metrics"`
	Configurations Configurations `json:"configurations"`
	Llm            Llm            `json:"llm"`
	Gpu            Gpu            `json:"gpu"`
}

type ConfigRecommendRequest

type ConfigRecommendRequest struct {
	Llm struct {
		Framework string  `json:"framework"`
		Param     float32 `json:"param"`
	} `json:"llm"`
	Gpu struct {
		Name string `json:"name"`
		Spec int    `json:"spec"`
		Num  int    `json:"num"`
	} `json:"gpu"`
}

type ConfigRecommendResult

type ConfigRecommendResult struct {
	MaxNumSeqs           int     `json:"max_num_seqs"`
	TensorParallelSize   int     `json:"tensor_parallel_size"`
	GpuMemoryUtilization float32 `json:"gpu_memory_utilization"`
	Replicas             int     `json:"replicas"`
}

type Configurations

type Configurations struct {
	MaxNumSeqs           int     `json:"max_num_seqs"`
	TensorParallelSize   int     `json:"tensor_parallel_size"`
	GPUMemoryUtilization float32 `json:"gpu_memory_utilization"`
	Replicas             int     `json:"replicas"`
}

type EmptyHeaderBuilder

type EmptyHeaderBuilder struct {
}

func (*EmptyHeaderBuilder) Build

func (hb *EmptyHeaderBuilder) Build() (map[string]string, error)

type EnvoaResponse

type EnvoaResponse struct {
	Code    int
	Message string
	Result  interface{}
	TraceId string
	Version string
}

type Gpu

type Gpu struct {
	Name string `json:"name"`
	Spec int    `json:"spec"`
	Num  int    `json:"num"`
}

type HeaderBuilderInterface

type HeaderBuilderInterface interface {
	Build() (map[string]string, error)
}

type HttpApi

type HttpApi[T HttpResponse] struct {
	Method        string
	Url           string
	HeaderBuilder HeaderBuilderInterface
}

func (*HttpApi[T]) Call

func (api *HttpApi[T]) Call(Params interface{}, Headers map[string]string) (T, error)

func (*HttpApi[T]) GetRequest

func (api *HttpApi[T]) GetRequest(Params interface{}, Headers map[string]string) (*http.Request, error)

type HttpResponse

type HttpResponse interface{}

type Llm

type Llm struct {
	Framework string  `json:"framework"`
	Param     float32 `json:"param"`
}

type Metric

type Metric map[string]string

type MetricValue

type MetricValue [2]float64

type Metrics

type Metrics struct {
	ActiveRequests        []MetricValue `json:"active_requests"`
	RunningRequests       []MetricValue `json:"running_requests"`
	PendingRequests       []MetricValue `json:"pending_requests"`
	GPUKVCacheUsage       []MetricValue `json:"gpu_kv_cache_usage"`
	ServerNewRequests     []MetricValue `json:"server_new_requests"`
	ServerSuccessRequests []MetricValue `json:"server_success_requests"`
}

type PromData

type PromData struct {
	ResultType string   `json:"resultType"`
	Result     []Series `json:"result"`
}

type PromResponse

type PromResponse struct {
	Status string
	Data   PromData
}

type Series

type Series struct {
	Metric Metric     `json:"metric"`
	Values []ValueSet `json:"values"`
}

type ValueSet

type ValueSet []interface{}

Jump to

Keyboard shortcuts

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