Commit 19f030f3 19f030f39b03af9134c97b7692d22e21c5fe2f23 by Christian Gerdes

Verkar som om jag fixade en NullPointer

- getSystemFileDescriptorsPercentUsed
1 parent b747bb02
...@@ -392,9 +392,13 @@ public class JmxMon { ...@@ -392,9 +392,13 @@ public class JmxMon {
392 public double getSystemFileDescriptorsPercentUsed() { 392 public double getSystemFileDescriptorsPercentUsed() {
393 LongDelta ldo = getAttributeLongDelta("java.lang:type=OperatingSystem", "OpenFileDescriptorCount"); 393 LongDelta ldo = getAttributeLongDelta("java.lang:type=OperatingSystem", "OpenFileDescriptorCount");
394 LongDelta ldm = getAttributeLongDelta("java.lang:type=OperatingSystem", "MaxFileDescriptorCount"); 394 LongDelta ldm = getAttributeLongDelta("java.lang:type=OperatingSystem", "MaxFileDescriptorCount");
395 if(ldo != null && ldm != null) {
395 double open = ldo.getCurrentValue(); 396 double open = ldo.getCurrentValue();
396 double max = ldm.getCurrentValue(); 397 double max = ldm.getCurrentValue();
397 return (open/max) * 100D; 398 return (open/max) * 100D;
399 } else {
400 return 0;
401 }
398 } 402 }
399 403
400 public double getHeapUsedMB() { 404 public double getHeapUsedMB() {
......