Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resources ¶ added in v1.0.4
type Resources struct {
CPUs int `json:"cpus,omitempty"`
Memory uint64 `json:"memory,omitempty" pretty:"format=bytes"`
Millis int `json:"millis,omitempty"` // CPU quota in millicores (e.g., 1500 = 1.5 CPUs)
}
Resources represents physical system resources
type SystemInfo ¶
type SystemInfo struct {
// Nested resource information
System Resources `json:"system,omitempty"` // Physical system resources
Container Resources `json:"container,omitempty"` // nil if not in container
// Other system information
IPAddresses []string `json:"ip_addresses,omitempty"`
OSType OSType `json:"os_type,omitempty"`
PostgreSQLVersion float64 `json:"postgres_version,omitempty"`
DiskType DiskType `json:"disk_type,omitempty"`
IsContainer bool `json:"is_container,omitempty"`
}
SystemInfo contains detected system information
func DetectSystemInfo ¶
func DetectSystemInfo() (*SystemInfo, error)
DetectSystemInfo automatically detects system information
func (*SystemInfo) EffectiveCPUCount ¶ added in v1.0.4
func (si *SystemInfo) EffectiveCPUCount() int
EffectiveCPUCount returns the effective CPU count for tuning Uses container CPU limit if available, otherwise system CPUs
func (*SystemInfo) EffectiveMemory ¶ added in v1.0.4
func (si *SystemInfo) EffectiveMemory() uint64
EffectiveMemory returns the effective memory for tuning Uses container memory limit if available, otherwise system memory
func (*SystemInfo) TotalMemoryGB ¶
func (si *SystemInfo) TotalMemoryGB() float64
TotalMemoryGB returns effective memory in GB
func (*SystemInfo) TotalMemoryKB ¶
func (si *SystemInfo) TotalMemoryKB() uint64
TotalMemoryKB returns effective memory in KB
func (*SystemInfo) TotalMemoryMB ¶
func (si *SystemInfo) TotalMemoryMB() float64
TotalMemoryMB returns effective memory in MB
Click to show internal directories.
Click to hide internal directories.