memory

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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(jaypipes): 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

type Info

type Info struct {
	TotalPhysicalBytes int64 `json:"total_physical_bytes"`
	TotalUsableBytes   int64 `json:"total_usable_bytes"`
	// An array of sizes, in bytes, of memory pages supported by the host
	SupportedPageSizes []uint64  `json:"supported_page_sizes"`
	Modules            []*Module `json:"modules"`
	// 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