Documentation ¶
Index ¶
Constants ¶
const ( // DEPRECATED: Please use CacheTypeUnified CACHE_TYPE_UNIFIED = CacheTypeUnified // DEPRECATED: Please use CacheTypeUnified CACHE_TYPE_INSTRUCTION = CacheTypeInstruction // DEPRECATED: Please use CacheTypeUnified CACHE_TYPE_DATA = CacheTypeData )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Area ¶ added in v0.9.0
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"` }
Area describes a set of physical memory on a host system. Non-NUMA systems will almost always have a single memory area containing all memory the system can use. NUMA systems will have multiple memory areas, one or more for each NUMA node/cell in the system.
func AreaForNode ¶ added in v0.9.0
type Cache ¶
type Cache struct { // Level is a 1-based numeric level that indicates the relative closeness // of this cache to processing cores on the physical package. Lower numbers // are "closer" to the processing cores and therefore have faster access // times. Level uint8 `json:"level"` // Type indicates what type of memory is stored in the cache. Can be // instruction (executable bytecodes), data or both. Type CacheType `json:"type"` // SizeBytes indicates the size of the cache in bytes. SizeBytes uint64 `json:"size_bytes"` // The set of logical processors (hardware threads) that have access to // this cache. LogicalProcessors []uint32 `json:"logical_processors"` }
Cache contains information about a single memory cache on a physical CPU package. Caches have a 1-based numeric level, with lower numbers indicating the cache is "closer" to the processing cores and reading memory from the cache will be faster relative to caches with higher levels. Note that this has nothing to do with RAM or memory modules like DIMMs.
type CacheType ¶
type CacheType int
CacheType indicates the type of memory stored in a memory cache.
const ( // CacheTypeUnified indicates the memory cache stores both instructions and // data. CacheTypeUnified CacheType = iota // CacheTypeInstruction indicates the memory cache stores only instructions // (executable bytecode). CacheTypeInstruction // CacheTypeData indicates the memory cache stores only data // (non-executable bytecode). CacheTypeData )
func (CacheType) MarshalJSON ¶
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) UnmarshalJSON ¶ added in v0.9.0
type Info ¶
type Info struct { Area // contains filtered or unexported fields }
Info contains information about the memory on a host system.
func (*Info) JSONString ¶
JSONString returns a string with the memory information formatted as JSON under a top-level "memory:" key
func (*Info) YAMLString ¶
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"` }
Module describes a single physical memory module for a host system. Pretty much all modern systems contain dual in-line memory modules (DIMMs).
type SortByCacheLevelTypeFirstProcessor ¶
type SortByCacheLevelTypeFirstProcessor []*Cache
func (SortByCacheLevelTypeFirstProcessor) Len ¶
func (a SortByCacheLevelTypeFirstProcessor) Len() int
func (SortByCacheLevelTypeFirstProcessor) Less ¶
func (a SortByCacheLevelTypeFirstProcessor) Less(i, j int) bool
func (SortByCacheLevelTypeFirstProcessor) Swap ¶
func (a SortByCacheLevelTypeFirstProcessor) Swap(i, j int)
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)