Using a struct to store all NVM-related information
Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@intel.com>
This commit is contained in:
parent
920cb80d65
commit
338904e6ed
@ -176,8 +176,7 @@ type MachineInfo struct {
|
|||||||
// Memory capacity and number of DIMMs by memory type
|
// Memory capacity and number of DIMMs by memory type
|
||||||
MemoryByType map[string]*MemoryInfo `json:"memory_by_type"`
|
MemoryByType map[string]*MemoryInfo `json:"memory_by_type"`
|
||||||
|
|
||||||
// Average power budget for NVM devices configured in BIOS.
|
NVMInfo NVMInfo `json:"nvm_info"`
|
||||||
NVMAvgPowerBudget uint `json:"nvm_avg_power_budget"`
|
|
||||||
|
|
||||||
// HugePages on this machine.
|
// HugePages on this machine.
|
||||||
HugePages []HugePagesInfo `json:"hugepages"`
|
HugePages []HugePagesInfo `json:"hugepages"`
|
||||||
@ -222,6 +221,11 @@ type MemoryInfo struct {
|
|||||||
DimmCount uint `json:"dimm_count"`
|
DimmCount uint `json:"dimm_count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type NVMInfo struct {
|
||||||
|
// Average power budget for NVM devices configured in BIOS.
|
||||||
|
AvgPowerBudget uint `json:"avg_power_budget"`
|
||||||
|
}
|
||||||
|
|
||||||
type VersionInfo struct {
|
type VersionInfo struct {
|
||||||
// Kernel version.
|
// Kernel version.
|
||||||
KernelVersion string `json:"kernel_version"`
|
KernelVersion string `json:"kernel_version"`
|
||||||
|
@ -119,23 +119,23 @@ func Info(sysFs sysfs.SysFs, fsInfo fs.FsInfo, inHostNamespace bool) (*info.Mach
|
|||||||
instanceID := realCloudInfo.GetInstanceID()
|
instanceID := realCloudInfo.GetInstanceID()
|
||||||
|
|
||||||
machineInfo := &info.MachineInfo{
|
machineInfo := &info.MachineInfo{
|
||||||
NumCores: numCores,
|
NumCores: numCores,
|
||||||
NumPhysicalCores: GetPhysicalCores(cpuinfo),
|
NumPhysicalCores: GetPhysicalCores(cpuinfo),
|
||||||
NumSockets: GetSockets(cpuinfo),
|
NumSockets: GetSockets(cpuinfo),
|
||||||
CpuFrequency: clockSpeed,
|
CpuFrequency: clockSpeed,
|
||||||
MemoryCapacity: memoryCapacity,
|
MemoryCapacity: memoryCapacity,
|
||||||
MemoryByType: memoryByType,
|
MemoryByType: memoryByType,
|
||||||
NVMAvgPowerBudget: nvmPowerBudget,
|
NVMInfo: info.NVMInfo{AvgPowerBudget: nvmPowerBudget},
|
||||||
HugePages: hugePagesInfo,
|
HugePages: hugePagesInfo,
|
||||||
DiskMap: diskMap,
|
DiskMap: diskMap,
|
||||||
NetworkDevices: netDevices,
|
NetworkDevices: netDevices,
|
||||||
Topology: topology,
|
Topology: topology,
|
||||||
MachineID: getInfoFromFiles(filepath.Join(rootFs, *machineIdFilePath)),
|
MachineID: getInfoFromFiles(filepath.Join(rootFs, *machineIdFilePath)),
|
||||||
SystemUUID: systemUUID,
|
SystemUUID: systemUUID,
|
||||||
BootID: getInfoFromFiles(filepath.Join(rootFs, *bootIdFilePath)),
|
BootID: getInfoFromFiles(filepath.Join(rootFs, *bootIdFilePath)),
|
||||||
CloudProvider: cloudProvider,
|
CloudProvider: cloudProvider,
|
||||||
InstanceType: instanceType,
|
InstanceType: instanceType,
|
||||||
InstanceID: instanceID,
|
InstanceID: instanceID,
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range filesystems {
|
for i := range filesystems {
|
||||||
|
Loading…
Reference in New Issue
Block a user