memory

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area struct {
	TotalPhysicalBytes int64 `json:"total_physical_bytes"`
	TotalUsableBytes   int64 `json:"total_usable_bytes"`
	// An array of sizes, in bytes, of memory pages supported in this area
	SupportedPageSizes []uint64  `json:"supported_page_sizes"`
	Modules            []*Module `json:"modules"`
}

func AreaForNode

func AreaForNode(ctx *context.Context, nodeID int) (*Area, error)

func (*Area) String

func (a *Area) String() string

type Cache

type Cache struct {
	Level     uint8     `json:"level"`
	Type      CacheType `json:"type"`
	SizeBytes uint64    `json:"size_bytes"`
	// The set of logical processors (hardware threads) that have access to the
	// cache
	LogicalProcessors []uint32 `json:"logical_processors"`
}

func CachesForNode

func CachesForNode(ctx *context.Context, nodeID int) ([]*Cache, error)

func (*Cache) String

func (c *Cache) String() string

type CacheType

type CacheType int
const (
	CACHE_TYPE_UNIFIED CacheType = iota
	CACHE_TYPE_INSTRUCTION
	CACHE_TYPE_DATA
)

func (CacheType) MarshalJSON

func (a CacheType) MarshalJSON() ([]byte, error)

NOTE(alihassan4198-tech): since serialized output is as "official" as we're going to get, let's lowercase the string output when serializing, in order to "normalize" the expected serialized output

func (CacheType) String

func (a CacheType) String() string

func (*CacheType) UnmarshalJSON

func (a *CacheType) UnmarshalJSON(b []byte) error

type Info

type Info struct {
	Area
	// contains filtered or unexported fields
}

func New

func New(opts ...*option.Option) (*Info, error)

func (*Info) JSONString

func (i *Info) JSONString(indent bool) string

JSONString returns a string with the memory information formatted as JSON under a top-level "memory:" key

func (*Info) String

func (i *Info) String() string

func (*Info) YAMLString

func (i *Info) YAMLString() string

YAMLString returns a string with the memory information formatted as YAML under a top-level "memory:" key

type Module

type Module struct {
	Label        string `json:"label"`
	Location     string `json:"location"`
	SerialNumber string `json:"serial_number"`
	SizeBytes    int64  `json:"size_bytes"`
	Vendor       string `json:"vendor"`
}

type SortByCacheLevelTypeFirstProcessor

type SortByCacheLevelTypeFirstProcessor []*Cache

func (SortByCacheLevelTypeFirstProcessor) Len

func (SortByCacheLevelTypeFirstProcessor) Less

func (SortByCacheLevelTypeFirstProcessor) Swap

type SortByLogicalProcessorId

type SortByLogicalProcessorId []uint32

func (SortByLogicalProcessorId) Len

func (a SortByLogicalProcessorId) Len() int

func (SortByLogicalProcessorId) Less

func (a SortByLogicalProcessorId) Less(i, j int) bool

func (SortByLogicalProcessorId) Swap

func (a SortByLogicalProcessorId) Swap(i, j int)

Jump to

Keyboard shortcuts

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