parent
b359520849
commit
3e4fc2659d
|
@ -52,8 +52,10 @@ public class SigarProcessProbe extends AbstractComponent implements ProcessProbe
|
||||||
ProcessStats stats = new ProcessStats();
|
ProcessStats stats = new ProcessStats();
|
||||||
stats.timestamp = System.currentTimeMillis();
|
stats.timestamp = System.currentTimeMillis();
|
||||||
stats.openFileDescriptors = JmxProcessProbe.getOpenFileDescriptorCount();
|
stats.openFileDescriptors = JmxProcessProbe.getOpenFileDescriptorCount();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (stats.openFileDescriptors == -1) {
|
||||||
|
stats.openFileDescriptors = sigar.getProcFd(sigar.getPid()).getTotal();
|
||||||
|
}
|
||||||
ProcCpu cpu = sigar.getProcCpu(sigar.getPid());
|
ProcCpu cpu = sigar.getProcCpu(sigar.getPid());
|
||||||
stats.cpu = new ProcessStats.Cpu();
|
stats.cpu = new ProcessStats.Cpu();
|
||||||
stats.cpu.percent = (short) (cpu.getPercent() * 100);
|
stats.cpu.percent = (short) (cpu.getPercent() * 100);
|
||||||
|
|
Loading…
Reference in New Issue