Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) GetDevice(ctx context.Context, uuid string) (*api.DeviceInfo, error)
- func (c *Client) GetDeviceAllocations(ctx context.Context, uuid string) ([]*api.WorkerAllocation, error)
- func (c *Client) GetGPUMetrics(ctx context.Context) (map[string]*api.GPUUsageMetrics, error)
- func (c *Client) GetWorker(ctx context.Context, workerID string) (*api.WorkerAllocation, map[string]map[string]map[string]*api.WorkerMetrics, ...)
- func (c *Client) GetWorkerMetrics(ctx context.Context) (map[string]map[string]map[string]*api.WorkerMetrics, error)
- func (c *Client) ListDevices(ctx context.Context) ([]*api.DeviceInfo, error)
- func (c *Client) ListWorkers(ctx context.Context) ([]*api.WorkerAllocation, error)
- type DeviceMetricsHistory
- type Model
- type ShmDialogModel
- type TimeSeriesChart
- type WorkerMetricsHistory
Constants ¶
This section is empty.
Variables ¶
var ( TitleStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("63")) SubtitleStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("241")) BorderStyle = lipgloss.NewStyle().Border(lipgloss.RoundedBorder()).BorderForeground(lipgloss.Color("62")) SelectedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("212")).Bold(true) NormalStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("250")) MetricLabelStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("243")).Width(20) MetricValueStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("39")).Bold(true) ChartBarStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("46")) ChartEmptyStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("238")) )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client for fetching data from the hypervisor server
func (*Client) GetDeviceAllocations ¶
func (c *Client) GetDeviceAllocations(ctx context.Context, uuid string) ([]*api.WorkerAllocation, error)
GetDeviceAllocations fetches allocations for a specific device
func (*Client) GetGPUMetrics ¶
GetGPUMetrics fetches GPU metrics for all devices Note: This is a placeholder until a dedicated metrics endpoint is available
func (*Client) GetWorker ¶
func (c *Client) GetWorker(ctx context.Context, workerID string) (*api.WorkerAllocation, map[string]map[string]map[string]*api.WorkerMetrics, error)
GetWorker fetches a specific worker by ID
func (*Client) GetWorkerMetrics ¶
func (c *Client) GetWorkerMetrics(ctx context.Context) (map[string]map[string]map[string]*api.WorkerMetrics, error)
GetWorkerMetrics fetches worker metrics for all workers This is optimized to batch requests when possible
func (*Client) ListDevices ¶
ListDevices fetches all devices from the hypervisor
func (*Client) ListWorkers ¶
ListWorkers fetches all workers from the hypervisor
type DeviceMetricsHistory ¶
type DeviceMetricsHistory struct {
MemoryChart *TimeSeriesChart
ComputeChart *TimeSeriesChart
TempChart *TimeSeriesChart
PowerChart *TimeSeriesChart
}
DeviceMetricsHistory tracks historical metrics for a device
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the TUI model
type ShmDialogModel ¶
type ShmDialogModel struct {
// contains filtered or unexported fields
}
ShmDialogModel represents the shared memory detail dialog
func NewShmDialogModel ¶
func NewShmDialogModel() *ShmDialogModel
NewShmDialogModel creates a new SHM dialog model
func (*ShmDialogModel) IsVisible ¶
func (m *ShmDialogModel) IsVisible() bool
IsVisible returns whether the dialog is visible
func (*ShmDialogModel) Show ¶
func (m *ShmDialogModel) Show(workerInfo *api.WorkerInfo)
Show displays the dialog with SHM details for the given worker
type TimeSeriesChart ¶
type TimeSeriesChart struct {
// contains filtered or unexported fields
}
TimeSeriesChart represents a time-series chart for metrics
func NewTimeSeriesChart ¶
func NewTimeSeriesChart(width, height int, label string) *TimeSeriesChart
NewTimeSeriesChart creates a new time-series chart
func (*TimeSeriesChart) AddDataPoint ¶
func (c *TimeSeriesChart) AddDataPoint(value float64)
AddDataPoint adds a new data point to the chart
func (*TimeSeriesChart) Render ¶
func (c *TimeSeriesChart) Render() string
Render renders the time-series chart as a string
func (*TimeSeriesChart) SetDimensions ¶
func (c *TimeSeriesChart) SetDimensions(width, height int)
SetDimensions sets the width and height of the chart
func (*TimeSeriesChart) SetMaxValue ¶
func (c *TimeSeriesChart) SetMaxValue(max float64)
SetMaxValue sets the maximum value for the chart scale
type WorkerMetricsHistory ¶
type WorkerMetricsHistory struct {
MemoryChart *TimeSeriesChart
ComputeChart *TimeSeriesChart
}
WorkerMetricsHistory tracks historical metrics for a worker