本文整理汇总了Java中org.hyperic.sigar.SigarNotImplementedException类的典型用法代码示例。如果您正苦于以下问题:Java SigarNotImplementedException类的具体用法?Java SigarNotImplementedException怎么用?Java SigarNotImplementedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SigarNotImplementedException类属于org.hyperic.sigar包,在下文中一共展示了SigarNotImplementedException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: output
import org.hyperic.sigar.SigarNotImplementedException; //导入依赖的package包/类
public void output(long pid) throws SigarException {
println("pid=" + pid);
try {
ProcFd fd = sigar.getProcFd(pid);
println("open file descriptors=" + fd.getTotal());
} catch (SigarNotImplementedException e) {}
ProcExe exe = sigar.getProcExe(pid);
String name = exe.getName();
if (name.length() == 0) {
name = "unknown";
}
println("name=" + name);
println("cwd=" + exe.getCwd());
}
示例2: getInfo
import org.hyperic.sigar.SigarNotImplementedException; //导入依赖的package包/类
public static String getInfo(SigarProxy sigar) throws SigarException {
double uptime = sigar.getUptime().getUptime();
String loadAverage;
try {
double[] avg = sigar.getLoadAverage();
loadAvg[0] = new Double(avg[0]);
loadAvg[1] = new Double(avg[1]);
loadAvg[2] = new Double(avg[2]);
loadAverage = "load average: " +
formatter.sprintf(loadAvg);
} catch (SigarNotImplementedException e) {
loadAverage = "(load average unknown)";
}
return
" " + getCurrentTime() +
" up " + formatUptime(uptime) +
", " + loadAverage;
}