Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
Name string `json:"n" cbor:"0,keyasint"`
State ServiceState `json:"s" cbor:"1,keyasint"`
Cpu float64 `json:"c" cbor:"2,keyasint"`
Mem uint64 `json:"m" cbor:"3,keyasint"`
MemPeak uint64 `json:"mp" cbor:"4,keyasint"`
Sub ServiceSubState `json:"ss" cbor:"5,keyasint"`
CpuPeak float64 `json:"cp" cbor:"6,keyasint"`
PrevCpuUsage uint64 `json:"-"`
PrevReadTime time.Time `json:"-"`
}
Service represents a single systemd service with its stats.
func (*Service) UpdateCPUPercent ¶
UpdateCPUPercent calculates the CPU usage percentage for the service.
type ServiceDependency ¶
type ServiceDependency struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
ActiveState string `json:"activeState,omitempty"`
SubState string `json:"subState,omitempty"`
}
ServiceDependency represents a unit that the service depends on.
type ServiceDetails ¶
ServiceDetails contains extended information about a systemd service.
type ServiceState ¶
type ServiceState uint8
ServiceState represents the status of a systemd service
const ( StatusActive ServiceState = iota StatusInactive StatusFailed StatusActivating StatusDeactivating StatusReloading )
func ParseServiceStatus ¶
func ParseServiceStatus(status string) ServiceState
ParseServiceStatus converts a string status to a ServiceStatus enum value
type ServiceSubState ¶
type ServiceSubState uint8
ServiceSubState represents the sub status of a systemd service
const ( SubStateDead ServiceSubState = iota SubStateRunning SubStateExited SubStateFailed SubStateUnknown )
func ParseServiceSubState ¶
func ParseServiceSubState(subState string) ServiceSubState
ParseServiceSubState converts a string sub status to a ServiceSubState enum value
Click to show internal directories.
Click to hide internal directories.