service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureArgs

type CaptureArgs struct {
	CaptureList []struct {
		Type      string `json:"type"`
		Name      string `json:"name"`
		Nodename  string `json:"nodename"`
		Namespace string `json:"namespace"`
	} `json:"capture_list"`
	CaptureDurationSeconds int    `json:"capture_duration_seconds"`
	Filter                 string `json:"filter"`
}

type CaptureTaskResult

type CaptureTaskResult struct {
	TaskID  int       `json:"task_id"`
	Spec    *TaskSpec `json:"spec"`
	Status  string    `json:"status"`
	Result  string    `json:"result"`
	Message string    `json:"message"`
}

todo reflect to generic task definition

type ControllerService

type ControllerService interface {
	rpc.ControllerRegisterServiceServer
	GetAgentList() []*rpc.AgentInfo
	Capture(ctx context.Context, capture *CaptureArgs) (int, error)
	CaptureList(ctx context.Context) (map[int][]*CaptureTaskResult, error)
	QueryRangeEvent(ctx context.Context, start, end time.Time, filters map[string][]string, limit int) ([]Event, error)
	Diagnose(ctx context.Context, args *skoopContext.TaskConfig) (int64, error)
	DiagnoseList(ctx context.Context) ([]DiagnoseTaskResult, error)
	DownloadCaptureFile(ctx context.Context, id int) (string, int64, io.ReadCloser, error)
	PodList(ctx context.Context) ([]*Pod, error)
	NodeList(ctx context.Context) ([]*Node, error)
	NamespaceList(ctx context.Context) ([]string, error)
	QueryPrometheus(ctx context.Context, query string, ts time.Time) (model.Value, promv1.Warnings, error)
	GetPodNodeInfoFromMetrics(ctx context.Context, ts time.Time) (model.Vector, model.Vector, error)
	PingMesh(ctx context.Context, pingmesh *PingMeshArgs) (*PingMeshResult, error)
	GetExporterConfig(ctx context.Context) (*exporter.InspServerConfig, error)
	UpdateExporterConfig(ctx context.Context, cfg *exporter.InspServerConfig) error
}

func NewControllerService

func NewControllerService() (ControllerService, error)

type DiagnoseTaskResult

type DiagnoseTaskResult struct {
	TaskID     int64  `json:"task_id" db:"id"`
	TaskConfig string `json:"task_config" db:"config"`
	StartTime  string `json:"start_time" db:"start_time"`
	FinishTime string `json:"finish_time" db:"finish_time"`
	Status     string `json:"status" db:"status"`
	Result     string `json:"result" db:"result"`
	Message    string `json:"message" db:"message"`
}

todo reflect to generic task definition

type Event

type Event struct {
	Node string `json:"node"`
	Time int    `json:"time"`
	probe.Event
}

type Latency

type Latency struct {
	Source     *NodeInfo `json:"source"`
	Target     *NodeInfo `json:"destination"`
	LatencyMax float64   `json:"latency_max"`
	LatencyMin float64   `json:"latency_min"`
	LatencyAvg float64   `json:"latency_avg"`
}

type Node

type Node struct {
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels"`
}

type NodeInfo

type NodeInfo struct {
	Type      string `json:"type"`
	Name      string `json:"name"`
	Nodename  string `json:"nodename"`
	Namespace string `json:"namespace"`
}

type PingMeshArgs

type PingMeshArgs struct {
	PingMeshList []NodeInfo `json:"ping_mesh_list"`
}

type PingMeshResult

type PingMeshResult struct {
	Nodes []NodeInfo `json:"nodes"`
	//unit ms
	Latencies []Latency `json:"latencies"`
}

type Pod

type Pod struct {
	Name      string            `json:"name"`
	Namespace string            `json:"namespace"`
	Nodename  string            `json:"nodename"`
	Labels    map[string]string `json:"labels"`
}

type TaskSpec

type TaskSpec struct {
	TaskType  string `json:"task_type"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

Jump to

Keyboard shortcuts

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