if (sigar == null) {
sigar = newSigar();
}
metricRegistry.registerAll(init(new CpuMetricSet(sigar, sigar.getCpuInfoList()[0])));
metricRegistry.registerAll(init(new MemoryMetricSet(sigar)));
metricRegistry.registerAll(init(new SwapMetricSet(sigar)));
for (String ifname : sigar.getNetInterfaceList()) {
metricRegistry.registerAll(init(new NetworkMetricSet(ifname, sigar)));
}
@SuppressWarnings("unchecked")
final Set<Map.Entry<String, FileSystem>> entries = (Set<Map.Entry<String, FileSystem>>) sigar.getFileSystemMap().entrySet();