app

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package model contains business logic wrappers. Alert logic has been moved to the data package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogMetricsCmd

func LogMetricsCmd(cpu, memory, disk, netRate float64, procCount int, enabled bool, logPath string) tea.Cmd

func SaveSnapshotCmd

func SaveSnapshotCmd(cpu, memory, disk float64, processCount int) tea.Cmd

func UpdateHealthScore added in v0.1.3

func UpdateHealthScore(s *data.AppState)

UpdateHealthScore calculates the system health score based on critical metrics. We start with 100 points and deduct points based on severity of usage (CPU, Memory, Disk, Temp).

func UpdateProcessHistory added in v0.1.3

func UpdateProcessHistory(s *data.AppState, alivePids map[int32]bool)

UpdateProcessHistory maintains a history buffer for the selected process and top resource consumers. This allows the charts to show history even if you just clicked on a process.

Types

type Model

type Model struct {
	data.AppState

	Provider struct {
		System  provider.SystemProvider
		Process provider.ProcessProvider
		Remote  provider.RemoteProvider
	}
	// contains filtered or unexported fields
}

func InitialModel

func InitialModel() *Model

func InitialModelWithConfig added in v0.6.0

func InitialModelWithConfig(cfg configpkg.AppConfig) *Model

func (*Model) GetBorder

func (m *Model) GetBorder() lipgloss.Border

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles all messages and updates the model

func (*Model) View

func (m *Model) View() tea.View

type RenderCache added in v0.5.0

type RenderCache struct {
	LastRenderTime time.Time
	Content        tea.View
	Force          bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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