only print cpuinfo once, it'll be the same for each

This commit is contained in:
Doug MacEachern 2005-07-21 02:57:15 +00:00
parent 4682ff2eab
commit 186ec234fc
1 changed files with 12 additions and 11 deletions

View File

@ -30,19 +30,20 @@ public class CpuInfo extends SigarCommandBase {
CpuPerc[] cpus = null;
println(infos.length + " total CPUs..");
net.hyperic.sigar.CpuInfo info = infos[0];
long cacheSize = info.getCacheSize();
println("Vendor........" + info.getVendor());
println("Model........." + info.getModel());
println("Mhz..........." + info.getMhz());
if (cacheSize != Sigar.FIELD_NOTIMPL) {
println("Cache size...." + cacheSize);
}
if (!this.displayTimes) {
return;
}
for (int i=0; i<infos.length; i++) {
net.hyperic.sigar.CpuInfo info = infos[i];
long cacheSize = info.getCacheSize();
println("Vendor........" + info.getVendor());
println("Model........." + info.getModel());
println("Mhz..........." + info.getMhz());
if (cacheSize != Sigar.FIELD_NOTIMPL) {
println("Cache size...." + cacheSize);
}
if (!this.displayTimes) {
continue;
}
if (cpus == null) {
cpus = this.sigar.getCpuPercList();
}