Documentation
¶
Index ¶
- Constants
- type ProcessAdapter
- func (a *ProcessAdapter) FetchOpenFilesCmd(pid int32) tea.Cmd
- func (a *ProcessAdapter) FetchProcessCmdlineCmd(pid int32) tea.Cmd
- func (a *ProcessAdapter) FetchProcessUsernameCmd(pid int32) tea.Cmd
- func (a *ProcessAdapter) PidsOnlyCmd() tea.Cmd
- func (a *ProcessAdapter) ProcessCountCmd() tea.Cmd
- func (a *ProcessAdapter) ProcessesCmd(sortBy string, sortDirection string) tea.Cmd
- func (a *ProcessAdapter) ReniceProcessCmdSafe(pid int32, delta int) tea.Cmd
- func (a *ProcessAdapter) ResumeProcessCmd(pid int32) tea.Cmd
- func (a *ProcessAdapter) SuspendProcessCmd(pid int32) tea.Cmd
- type ProcessProvider
- type RemoteAdapter
- type RemoteProvider
- type SystemAdapter
- func (a *SystemAdapter) BatteryCmd() tea.Cmd
- func (a *SystemAdapter) ConnectionsCmd() tea.Cmd
- func (a *SystemAdapter) DetectHardware()
- func (a *SystemAdapter) DiskIOCmd() tea.Cmd
- func (a *SystemAdapter) DiskInfoCmd() tea.Cmd
- func (a *SystemAdapter) FastMetricsCmd() tea.Cmd
- func (a *SystemAdapter) GpuInfoCmd() tea.Cmd
- func (a *SystemAdapter) HasAmdGPU() bool
- func (a *SystemAdapter) HasBattery() bool
- func (a *SystemAdapter) HasDiskIO() bool
- func (a *SystemAdapter) HasNetworkInterfaces() bool
- func (a *SystemAdapter) HasNvidiaGPU() bool
- func (a *SystemAdapter) HasServices() bool
- func (a *SystemAdapter) HasTempSensors() bool
- func (a *SystemAdapter) HostInfoCmd() tea.Cmd
- func (a *SystemAdapter) NetworkInterfacesCmd() tea.Cmd
- func (a *SystemAdapter) ServicesCmd() tea.Cmd
- func (a *SystemAdapter) SlowMetricsCmd() tea.Cmd
- func (a *SystemAdapter) SystemLogsCmd() tea.Cmd
- func (a *SystemAdapter) TempCmd() tea.Cmd
- func (a *SystemAdapter) TickCmd(d time.Duration) tea.Cmd
- type SystemProvider
Constants ¶
const ( // Logging MaxLogLines = 1000 // Timeouts SSHTimeout = 2 * time.Second // Process Management ProcessListCapacity = 500 InternerCleanupFrequency = 1000 // Network NetworkBaseRateMBps = 10.0 // Protocols ProtoTCP = 1 ProtoUDP = 2 )
Provider Limits and Timeouts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProcessAdapter ¶ added in v0.5.0
type ProcessAdapter struct{}
ProcessAdapter wraps process provider functions and implements ProcessProvider interface.
func NewProcessAdapter ¶ added in v0.5.0
func NewProcessAdapter() *ProcessAdapter
NewProcessAdapter creates a new ProcessAdapter instance.
func (*ProcessAdapter) FetchOpenFilesCmd ¶ added in v0.5.0
func (a *ProcessAdapter) FetchOpenFilesCmd(pid int32) tea.Cmd
FetchOpenFilesCmd returns a command that fetches open files for a process.
func (*ProcessAdapter) FetchProcessCmdlineCmd ¶ added in v0.5.0
func (a *ProcessAdapter) FetchProcessCmdlineCmd(pid int32) tea.Cmd
FetchProcessCmdlineCmd returns a command that lazily fetches cmdline for a process.
func (*ProcessAdapter) FetchProcessUsernameCmd ¶ added in v0.5.0
func (a *ProcessAdapter) FetchProcessUsernameCmd(pid int32) tea.Cmd
FetchProcessUsernameCmd returns a command that lazily fetches username for a process.
func (*ProcessAdapter) PidsOnlyCmd ¶ added in v0.5.0
func (a *ProcessAdapter) PidsOnlyCmd() tea.Cmd
PidsOnlyCmd returns a command that fetches only PIDs for cache warming (lightweight).
func (*ProcessAdapter) ProcessCountCmd ¶ added in v0.5.0
func (a *ProcessAdapter) ProcessCountCmd() tea.Cmd
ProcessCountCmd returns a command that fetches the number of running processes (lightweight).
func (*ProcessAdapter) ProcessesCmd ¶ added in v0.5.0
func (a *ProcessAdapter) ProcessesCmd(sortBy string, sortDirection string) tea.Cmd
ProcessesCmd returns a command that fetches all running processes with sorting.
func (*ProcessAdapter) ReniceProcessCmdSafe ¶ added in v0.5.0
func (a *ProcessAdapter) ReniceProcessCmdSafe(pid int32, delta int) tea.Cmd
ReniceProcessCmdSafe returns a command that changes process priority.
func (*ProcessAdapter) ResumeProcessCmd ¶ added in v0.5.0
func (a *ProcessAdapter) ResumeProcessCmd(pid int32) tea.Cmd
ResumeProcessCmd returns a command that resumes a suspended process.
func (*ProcessAdapter) SuspendProcessCmd ¶ added in v0.5.0
func (a *ProcessAdapter) SuspendProcessCmd(pid int32) tea.Cmd
SuspendProcessCmd returns a command that suspends a process.
type ProcessProvider ¶ added in v0.5.0
type ProcessProvider interface {
// ProcessesCmd returns a command that fetches all running processes with sorting.
ProcessesCmd(sortBy string, sortDirection string) tea.Cmd
// ProcessCountCmd returns a command that fetches the number of running processes (lightweight).
ProcessCountCmd() tea.Cmd
// PidsOnlyCmd returns a command that fetches only PIDs for cache warming (lightweight).
PidsOnlyCmd() tea.Cmd
// ReniceProcessCmdSafe returns a command that changes process priority.
// delta < 0 increases priority, delta > 0 decreases priority.
ReniceProcessCmdSafe(pid int32, delta int) tea.Cmd
// SuspendProcessCmd returns a command that suspends a process.
SuspendProcessCmd(pid int32) tea.Cmd
// ResumeProcessCmd returns a command that resumes a suspended process.
ResumeProcessCmd(pid int32) tea.Cmd
// FetchOpenFilesCmd returns a command that fetches open files for a process.
FetchOpenFilesCmd(pid int32) tea.Cmd
// FetchProcessCmdlineCmd returns a command that lazily fetches cmdline for a process.
FetchProcessCmdlineCmd(pid int32) tea.Cmd
// FetchProcessUsernameCmd returns a command that lazily fetches username for a process.
FetchProcessUsernameCmd(pid int32) tea.Cmd
}
ProcessProvider defines the interface for process management providers. Each method returns a tea.Cmd that produces a message when executed.
type RemoteAdapter ¶ added in v0.5.0
type RemoteAdapter struct{}
RemoteAdapter wraps remote provider functions and implements RemoteProvider interface.
func NewRemoteAdapter ¶ added in v0.5.0
func NewRemoteAdapter() *RemoteAdapter
NewRemoteAdapter creates a new RemoteAdapter instance.
func (*RemoteAdapter) CheckRemoteCmd ¶ added in v0.5.0
func (a *RemoteAdapter) CheckRemoteCmd(host config.RemoteHostConfig) tea.Cmd
CheckRemoteCmd returns a command that checks remote host connectivity and fetches full metrics.
type RemoteProvider ¶ added in v0.5.0
type RemoteProvider interface {
// CheckRemoteCmd returns a command that checks remote host connectivity and fetches full metrics.
CheckRemoteCmd(host config.RemoteHostConfig) tea.Cmd
}
RemoteProvider defines the interface for remote system access providers. Each method returns a tea.Cmd that produces a message when executed.
type SystemAdapter ¶ added in v0.5.0
type SystemAdapter struct{}
SystemAdapter wraps system provider functions and implements SystemProvider interface.
func NewSystemAdapter ¶ added in v0.5.0
func NewSystemAdapter() *SystemAdapter
NewSystemAdapter creates a new SystemAdapter instance.
func (*SystemAdapter) BatteryCmd ¶ added in v0.5.0
func (a *SystemAdapter) BatteryCmd() tea.Cmd
BatteryCmd returns a command that fetches battery status.
func (*SystemAdapter) ConnectionsCmd ¶ added in v0.5.0
func (a *SystemAdapter) ConnectionsCmd() tea.Cmd
ConnectionsCmd returns a command that fetches network connections.
func (*SystemAdapter) DetectHardware ¶ added in v0.5.0
func (a *SystemAdapter) DetectHardware()
DetectHardware runs hardware capability detection.
func (*SystemAdapter) DiskIOCmd ¶ added in v0.5.0
func (a *SystemAdapter) DiskIOCmd() tea.Cmd
DiskIOCmd returns a command that fetches disk I/O statistics.
func (*SystemAdapter) DiskInfoCmd ¶ added in v0.5.0
func (a *SystemAdapter) DiskInfoCmd() tea.Cmd
DiskInfoCmd returns a command that fetches disk partition information.
func (*SystemAdapter) FastMetricsCmd ¶ added in v0.5.0
func (a *SystemAdapter) FastMetricsCmd() tea.Cmd
FastMetricsCmd returns a command that fetches CPU, memory, and load average metrics.
func (*SystemAdapter) GpuInfoCmd ¶ added in v0.5.0
func (a *SystemAdapter) GpuInfoCmd() tea.Cmd
GpuInfoCmd returns a command that fetches GPU information.
func (*SystemAdapter) HasAmdGPU ¶ added in v0.5.0
func (a *SystemAdapter) HasAmdGPU() bool
HasAmdGPU returns true if an AMD GPU is detected.
func (*SystemAdapter) HasBattery ¶ added in v0.5.0
func (a *SystemAdapter) HasBattery() bool
HasBattery returns true if a battery is detected.
func (*SystemAdapter) HasDiskIO ¶ added in v0.5.0
func (a *SystemAdapter) HasDiskIO() bool
HasDiskIO returns true if disk I/O metrics are available.
func (*SystemAdapter) HasNetworkInterfaces ¶ added in v0.5.0
func (a *SystemAdapter) HasNetworkInterfaces() bool
HasNetworkInterfaces returns true if network interfaces are detected.
func (*SystemAdapter) HasNvidiaGPU ¶ added in v0.5.0
func (a *SystemAdapter) HasNvidiaGPU() bool
HasNvidiaGPU returns true if an NVIDIA GPU is detected.
func (*SystemAdapter) HasServices ¶ added in v0.5.0
func (a *SystemAdapter) HasServices() bool
HasServices returns true if system services are available.
func (*SystemAdapter) HasTempSensors ¶ added in v0.5.0
func (a *SystemAdapter) HasTempSensors() bool
HasTempSensors returns true if temperature sensors are available.
func (*SystemAdapter) HostInfoCmd ¶ added in v0.5.0
func (a *SystemAdapter) HostInfoCmd() tea.Cmd
HostInfoCmd returns a command that fetches host information.
func (*SystemAdapter) NetworkInterfacesCmd ¶ added in v0.5.0
func (a *SystemAdapter) NetworkInterfacesCmd() tea.Cmd
NetworkInterfacesCmd returns a command that fetches network interface statistics.
func (*SystemAdapter) ServicesCmd ¶ added in v0.5.0
func (a *SystemAdapter) ServicesCmd() tea.Cmd
ServicesCmd returns a command that fetches system services.
func (*SystemAdapter) SlowMetricsCmd ¶ added in v0.5.0
func (a *SystemAdapter) SlowMetricsCmd() tea.Cmd
SlowMetricsCmd returns a command that fetches disk and network I/O metrics.
func (*SystemAdapter) SystemLogsCmd ¶ added in v0.5.0
func (a *SystemAdapter) SystemLogsCmd() tea.Cmd
SystemLogsCmd returns a command that fetches system logs.
func (*SystemAdapter) TempCmd ¶ added in v0.5.0
func (a *SystemAdapter) TempCmd() tea.Cmd
TempCmd returns a command that fetches temperature sensor data.
type SystemProvider ¶ added in v0.5.0
type SystemProvider interface {
// TickCmd returns a command that sends tick messages at the specified duration.
TickCmd(d time.Duration) tea.Cmd
// FastMetricsCmd returns a command that fetches CPU, memory, and load average metrics.
FastMetricsCmd() tea.Cmd
// SlowMetricsCmd returns a command that fetches disk and network I/O metrics.
SlowMetricsCmd() tea.Cmd
// HostInfoCmd returns a command that fetches host information (OS, platform, uptime, etc.).
HostInfoCmd() tea.Cmd
// GpuInfoCmd returns a command that fetches GPU information (NVIDIA, AMD, Intel).
GpuInfoCmd() tea.Cmd
// TempCmd returns a command that fetches temperature sensor data.
TempCmd() tea.Cmd
// BatteryCmd returns a command that fetches battery status.
BatteryCmd() tea.Cmd
// DiskInfoCmd returns a command that fetches disk partition information.
DiskInfoCmd() tea.Cmd
// DiskIOCmd returns a command that fetches disk I/O statistics.
DiskIOCmd() tea.Cmd
// NetworkInterfacesCmd returns a command that fetches network interface statistics.
NetworkInterfacesCmd() tea.Cmd
// ConnectionsCmd returns a command that fetches network connections.
ConnectionsCmd() tea.Cmd
// ServicesCmd returns a command that fetches system services.
ServicesCmd() tea.Cmd
// SystemLogsCmd returns a command that fetches system logs.
SystemLogsCmd() tea.Cmd
// HasNvidiaGPU returns true if an NVIDIA GPU is detected.
HasNvidiaGPU() bool
// HasAmdGPU returns true if an AMD GPU is detected.
HasAmdGPU() bool
// HasBattery returns true if a battery is detected.
HasBattery() bool
// HasNetworkInterfaces returns true if network interfaces are detected.
HasNetworkInterfaces() bool
// HasDiskIO returns true if disk I/O metrics are available.
HasDiskIO() bool
// HasServices returns true if system services are available.
HasServices() bool
// HasTempSensors returns true if temperature sensors are available.
HasTempSensors() bool
// DetectHardware runs hardware capability detection.
DetectHardware()
}
SystemProvider defines the interface for system metrics providers. Each method returns a tea.Cmd that produces a message when executed.