add total_cores and total_sockets to sigar_cpu_info_t
This commit is contained in:
1 parent
949147d4ba
commit
187df2f462
4 files changed
+32
-7
No files matched your search
@@ -501,6 +501,14 @@ use vars qw(%classes %cmds);
|
||||
desc => 'CPU cache size',
|
||||
plat => 'AL'
|
||||
},
|
||||
{
|
||||
name => 'total_cores', type => 'Int',
|
||||
desc => 'Total CPU cores (logical)',
|
||||
},
|
||||
{
|
||||
name => 'total_sockets', type => 'Int',
|
||||
desc => 'Total CPU sockets (physical)',
|
||||
},
|
||||
],
|
||||
Uptime => [
|
||||
{
|
||||
|
||||
@@ -58,12 +58,16 @@ public class CpuInfo extends SigarCommandBase {
|
||||
CpuPerc[] cpus =
|
||||
this.sigar.getCpuPercList();
|
||||
|
||||
println(cpus.length + " total CPUs..");
|
||||
org.hyperic.sigar.CpuInfo info = infos[0];
|
||||
long cacheSize = info.getCacheSize();
|
||||
println("Vendor........" + info.getVendor());
|
||||
println("Model........." + info.getModel());
|
||||
println("Mhz..........." + info.getMhz());
|
||||
println("Vendor........." + info.getVendor());
|
||||
println("Model.........." + info.getModel());
|
||||
println("Mhz............" + info.getMhz());
|
||||
println("Total CPUs....." + info.getTotalCores());
|
||||
if (info.getTotalCores() != info.getTotalSockets()) {
|
||||
println("Physical CPUs.." + info.getTotalSockets());
|
||||
}
|
||||
|
||||
if (cacheSize != Sigar.FIELD_NOTIMPL) {
|
||||
println("Cache size...." + cacheSize);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user