memory

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package memory regroups collecting information about the memory

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info added in v0.47.0

type Info struct {
	// TotalBytes is the total memory for the host in byte
	TotalBytes utils.Value[uint64] `json:"total"`
	// SwapTotalBytes is the swap memory size in kilobyte (Unix only)
	SwapTotalKb utils.Value[uint64] `json:"swap_total" unit:"kB"`
}

Info holds memory metadata about the host

func CollectInfo added in v0.47.0

func CollectInfo() *Info

CollectInfo returns an Info struct with every field initialized either to a value or an error. The method will try to collect as many fields as possible.

func (*Info) AsJSON added in v0.47.0

func (info *Info) AsJSON() (interface{}, []string, error)

AsJSON returns an interface which can be marshalled to a JSON and contains the value of non-errored fields.

Jump to

Keyboard shortcuts

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