memory

package
v0.0.0-...-3f8e3b8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 8 Imported by: 0

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

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

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

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