will be reusing CpuInfo

This commit is contained in:
Doug MacEachern 2008-10-09 06:15:02 +00:00
parent 1c75927eca
commit 7985dea967
1 changed files with 15 additions and 13 deletions

View File

@ -222,21 +222,23 @@ public class SigarRegistry extends AbstractMBean {
return; return;
//CPU beans //CPU beans
CpuInfo[] info;
try { try {
CpuInfo[] info = sigar.getCpuInfoList(); info = sigar.getCpuInfoList();
for (int i=0; i<info.length; i++) {
String idx = String.valueOf(i);
ReflectedMBean mbean =
new ReflectedMBean(sigarImpl, "CpuCoreTime", idx);
mbean.setType("CpuList");
registerMBean(mbean);
mbean =
new ReflectedMBean(sigarImpl, "CpuCoreUsage", idx);
mbean.setType("CpuPercList");
registerMBean(mbean);
}
} catch (SigarException e) { } catch (SigarException e) {
throw unexpectedError("CpuInfoList", e); throw unexpectedError("CpuInfoList", e);
}
for (int i=0; i<info.length; i++) {
String idx = String.valueOf(i);
ReflectedMBean mbean =
new ReflectedMBean(sigarImpl, "CpuCoreTime", idx);
mbean.setType("CpuList");
registerMBean(mbean);
mbean =
new ReflectedMBean(sigarImpl, "CpuCoreUsage", idx);
mbean.setType("CpuPercList");
registerMBean(mbean);
} }
//FileSystem beans //FileSystem beans