Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BssData ¶
type BssData struct {
Usersched_last_run_at uint64 `json:"usersched_last_run_at"` // The PID of the userspace scheduler
Nr_queued uint64 `json:"nr_queued"` // Number of tasks queued in the userspace scheduler
Nr_scheduled uint64 `json:"nr_scheduled"` // Number of tasks scheduled by the userspace scheduler
Nr_running uint64 `json:"nr_running"` // Number of tasks currently running in the userspace scheduler
Nr_online_cpus uint64 `json:"nr_online_cpus"` // Number of online CPUs in the system
Nr_user_dispatches uint64 `json:"nr_user_dispatches"` // Number of user-space dispatches
Nr_kernel_dispatches uint64 `json:"nr_kernel_dispatches"` // Number of kernel-space dispatches
Nr_cancel_dispatches uint64 `json:"nr_cancel_dispatches"` // Number of cancelled dispatches
Nr_bounce_dispatches uint64 `json:"nr_bounce_dispatches"` // Number of bounce dispatches
Nr_failed_dispatches uint64 `json:"nr_failed_dispatches"` // Number of failed dispatches
Nr_sched_congested uint64 `json:"nr_sched_congested"` // Number of times the scheduler was congested
UpdatedTime time.Time `json:"-"` // Timestamp of the last update
}
BssData represents the metrics data structure
type LabelSelector ¶
type LabelSelector struct {
Key string `json:"key"` // Label key
Value string `json:"value"` // Label value
}
LabelSelector represents a key-value pair for pod label selection
type PodInfo ¶
type PodInfo struct {
PodName string `json:"pod_name"`
Namespace string `json:"namespace"`
PodUID string `json:"pod_uid"`
ContainerID string `json:"container_id,omitempty"`
Processes []PodProcess `json:"processes"`
}
PodInfo represents pod information with associated processes
type PodProcess ¶
type PodProcess struct {
PID int `json:"pid"`
Command string `json:"command"`
PPID int `json:"ppid,omitempty"`
}
PodProcess represents a process information within a pod
type SchedulingStrategy ¶
type SchedulingStrategy struct {
Priority bool `json:"priority"` // If true, set vtime to minimum vtime
ExecutionTime uint64 `json:"execution_time"` // Time slice for this process in nanoseconds
PID int `json:"pid,omitempty"` // Process ID to apply this strategy to
Selectors []LabelSelector `json:"selectors,omitempty"` // Label selectors to match pods
CommandRegex string `json:"command_regex,omitempty"` // Regex to match process command
}
SchedulingStrategy represents a strategy for process scheduling
type Service ¶
type Service interface {
// VerifyAndGenerateToken verifies the provided public key and generates a JWT token if valid
VerifyAndGenerateToken(ctx context.Context, publicKey string) (string, error)
// GetAllPodInfos retrieves all pod information by scanning the /proc filesystem
GetAllPodInfos(ctx context.Context) ([]*PodInfo, error)
// SaveBSSMetrics saves the provided BSS metrics data
SaveBSSMetrics(ctx context.Context, bssMetrics *BssData) error
// GetBSSMetrics retrieves the latest BSS metrics data
GetBSSMetrics(ctx context.Context) (*BssData, error)
// SaveSchedulingStrategy saves the provided scheduling strategies
SaveSchedulingStrategy(ctx context.Context, strategy []*SchedulingStrategy) error
// FindCurrentUsingSchedulingStrategiesWithPID finds the current scheduling strategies being used and their associated PIDs
FindCurrentUsingSchedulingStrategiesWithPID(ctx context.Context) ([]*SchedulingStrategy, bool, error)
// GetStrategyCacheStats returns statistics about the strategy cache
GetStrategyCacheStats() map[string]any
}
Service defines the interface for the service layer
Click to show internal directories.
Click to hide internal directories.