Skip to content

Commit

Permalink
fix: cpu core computation
Browse files Browse the repository at this point in the history
fix wrong computation when only one package is available as
totalCore was divided by the reference value, not just 1
  • Loading branch information
g-bougard authored Sep 28, 2018
1 parent 95ea6f1 commit 9e7ae7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ deploy:
esx:
* Support 2 ServiceTags case to cover chassis & lame board S/N inventory
* Updated AssetTag support
* fix wrong cpu core computation when only one package is available

netdiscovery/netinventory:
* Thanks to @QuickNerd357, Brocade devices will now show serial number and
Expand Down
4 changes: 3 additions & 1 deletion lib/FusionInventory/Agent/SOAP/VMware/Host.pm
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ sub getCPUs {
my $totalCore = $hardware->{cpuInfo}{numCpuCores};
my $totalThread = $hardware->{cpuInfo}{numCpuThreads};
my $cpuEntries = $hardware->{cpuPkg};
my $cpuPackages = $hardware->{cpuInfo}{numCpuPackages} ||
scalar(_asArray($cpuEntries));

my @cpus;
foreach (_asArray($cpuEntries)) {
push @cpus,
{
CORE => $totalCore / _asArray($cpuEntries),
CORE => eval { $totalCore / $cpuPackages },
MANUFACTURER => $cpuManufacturor{ $_->{vendor} } || $_->{vendor},
NAME => $_->{description},
SPEED => int( $_->{hz} / ( 1000 * 1000 ) ),
Expand Down

0 comments on commit 9e7ae7b

Please sign in to comment.