Documentation
¶
Overview ¶
Package memory tracks the memory usage of the host.
Index ¶
- Constants
- func Get(ctx context.Context) (_ any, e error)
- func HasEDACCorrectableErrors(line string) bool
- func HasOOM(line string) bool
- func HasOOMCgroup(line string) bool
- func HasOOMKillConstraint(line string) bool
- func HasOOMKiller(line string) bool
- func Match(line string) (eventName string, message string)
- func New(ctx context.Context, cfg Config) (components.Component, error)
- type Config
- type Output
Constants ¶
View Source
const ( StateKeyVirtualMemory = "virtual_memory" StateKeyTotalBytes = "total_bytes" StateKeyTotalHumanized = "total_humanized" StateKeyAvailableBytes = "available_bytes" StateKeyAvailableHumanized = "available_humanized" StateKeyUsedBytes = "used_bytes" StateKeyUsedHumanized = "used_humanized" StateKeyUsedPercent = "used_percent" StateKeyFreeBytes = "free_bytes" StateKeyFreeHumanized = "free_humanized" StateKeyVMAllocTotalBytes = "vm_alloc_total_bytes" StateKeyVMAllocTotalHumanized = "vm_alloc_total_humanized" StateKeyVMAllocUsedBytes = "vm_alloc_used_bytes" StateKeyVMAllocUsedHumanized = "vm_alloc_used_humanized" StateKeyVMAllocUsedPercent = "vm_alloc_used_percent" StateKeyBPFJITBufferBytes = "bpf_jit_buffer_bytes" StateKeyBPFJITBufferHumanized = "bpf_jit_buffer_humanized" )
Variables ¶
This section is empty.
Functions ¶
func HasEDACCorrectableErrors ¶ added in v0.4.4
func HasOOM ¶ added in v0.4.4
Returns true if the line indicates that the file-max limit has been reached. ref. https://docs.kernel.org/admin-guide/sysctl/fs.html#file-max-file-nr
func HasOOMCgroup ¶ added in v0.4.4
func HasOOMKillConstraint ¶ added in v0.4.4
func HasOOMKiller ¶ added in v0.4.4
Types ¶
type Config ¶
type Config struct {
Query query_config.Config `json:"query"`
}
type Output ¶
type Output struct {
TotalBytes uint64 `json:"total_bytes"`
TotalHumanized string `json:"total_humanized"`
AvailableBytes uint64 `json:"available_bytes"`
AvailableHumanized string `json:"available_humanized"`
UsedBytes uint64 `json:"used_bytes"`
UsedHumanized string `json:"used_humanized"`
UsedPercent string `json:"used_percent"`
FreeBytes uint64 `json:"free_bytes"`
FreeHumanized string `json:"free_humanized"`
VMAllocTotalBytes uint64 `json:"vm_alloc_total_bytes"`
VMAllocTotalHumanized string `json:"vm_alloc_total_humanized"`
VMAllocUsedBytes uint64 `json:"vm_alloc_used_bytes"`
VMAllocUsedHumanized string `json:"vm_alloc_used_humanized"`
VMAllocUsedPercent string `json:"vm_alloc_used_percent"`
// Represents the current BPF JIT buffer size in bytes.
// ref. "cat /proc/vmallocinfo | grep bpf_jit | awk '{s+=$2} END {print s}'"
BPFJITBufferBytes uint64 `json:"bpf_jit_buffer_bytes"`
BPFJITBufferHumanized string `json:"bpf_jit_buffer_humanized"`
}
func ParseOutputJSON ¶
func ParseStatesToOutput ¶
func ParseStatesToOutput(states ...components.State) (*Output, error)
func (Output) GetUsedPercent ¶
Click to show internal directories.
Click to hide internal directories.