Documentation
¶
Overview ¶
Package mem provides memory usage statistics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Darwin ¶
type Darwin struct {
provider.FactsAware
VirtualMemoryFn func() (*mem.VirtualMemoryStat, error)
}
Darwin implements the Mem interface for Darwin (macOS).
func NewDarwinProvider ¶
func NewDarwinProvider() *Darwin
NewDarwinProvider factory to create a new Darwin instance.
type Debian ¶
type Debian struct {
provider.FactsAware
VirtualMemoryFn func() (*mem.VirtualMemoryStat, error)
}
Debian implements the Mem interface for Debian.
func NewDebianProvider ¶
func NewDebianProvider() *Debian
NewDebianProvider factory to create a new Debian instance.
type Linux ¶
type Linux struct {
provider.FactsAware
}
Linux implements the Mem interface for Linux.
func NewLinuxProvider ¶
func NewLinuxProvider() *Linux
NewLinuxProvider factory to create a new Linux instance.
type Provider ¶
type Provider interface {
// GetStats retrieves memory statistics of the system.
GetStats() (*Result, error)
}
Provider implements the methods to interact with various Mem components.
type Result ¶
type Result struct {
// Total memory in bytes
Total uint64
// Available memory in bytes (free + reclaimable)
Available uint64
// Free memory in bytes
Free uint64
// Cached memory in bytes
Cached uint64
// Changed indicates whether system state was modified.
Changed bool `json:"changed"`
}
Result holds memory information in bytes.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.