if(cName.equals(Constants.UTIL_PERCENT_CPU)) {
CpuUtilization cpu = cru.getCpuUtilization();
value = (cpu == null ? "?" : formatPercent(cpu.getValue()));
} else if(cName.equals(Constants.UTIL_PERCENT_MEMORY)) {
SystemMemoryUtilization mem = cru.getSystemMemoryUtilization();
value = (mem == null ? "?" : formatPercent(mem.getValue()));
} else if(cName.equals(Constants.UTIL_TOTAL_MEMORY)) {
SystemMemoryUtilization mem = cru.getSystemMemoryUtilization();
value = (mem == null ? "?" : format(mem.getTotal()," MB"));
} else if(cName.equals(Constants.UTIL_FREE_MEMORY)) {
SystemMemoryUtilization mem = cru.getSystemMemoryUtilization();
value = (mem == null ? "?" : format(mem.getFree()," MB"));
} else if(cName.equals(Constants.UTIL_USED_MEMORY)) {
SystemMemoryUtilization mem = cru.getSystemMemoryUtilization();
value = (mem == null ? "?" : format(mem.getUsed()," MB"));
} else if(cName.equals(Constants.UTIL_PERCENT_DISK)) {
DiskSpaceUtilization disk = cru.getDiskSpaceUtilization();
value = (disk==null?"?" : formatPercent(disk.getValue()));
} else if(cName.equals(Constants.UTIL_AVAIL_DISK)) {
DiskSpaceUtilization disk = cru.getDiskSpaceUtilization();
value = (disk==null?"?" : format(disk.getAvailable()/MeasuredValueHelper.GB," GB"));
} else if(cName.equals(Constants.UTIL_TOTAL_DISK)) {
DiskSpaceUtilization disk = cru.getDiskSpaceUtilization();
value = (disk==null?"?" : format(disk.getCapacity()/MeasuredValueHelper.GB," GB"));
}
}
if(cName.equals(Constants.UTIL_PERCENT_CPU_PROC)) {
value = formatPercent(MeasuredValueHelper.getMeasuredValue(SystemWatchID.PROC_CPU, cru));
} else if(cName.equals(Constants.UTIL_PERCENT_HEAP_JVM)) {
value = formatPercent(MeasuredValueHelper.getMeasuredValue(SystemWatchID.JVM_MEMORY, cru));
//ProcessMemoryUtilization mem = cru.getProcessMemoryUtilization();
//value = (mem==null?"?" : format(mem.getUsedHeap()));
} else if(cName.equals(Constants.UTIL_HEAP_MEM_JVM)) {
ProcessMemoryUtilization mem = cru.getProcessMemoryUtilization();
//value = (mem==null?"?" : format(mem.getCommittedHeap())+" MB");
value = (mem==null?"?" : format(mem.getUsedHeap()," MB"));
} else if(cName.equals(Constants.UTIL_HEAP_MEM_AVAIL)) {
ProcessMemoryUtilization mem = cru.getProcessMemoryUtilization();
//value = (mem==null?"?" : format(mem.getCommittedHeap())+" MB");
value = (mem==null?"?" : format(mem.getCommittedHeap(), " MB"));
} else if(cName.equals(Constants.UTIL_REAL_MEM_PROC)) {
ProcessMemoryUtilization mem = cru.getProcessMemoryUtilization();
value = (mem==null?"?" : format(mem.getResident(), " MB"));
}
if(isAThresholdColumn(cName)) {
return getThresholdLabel(cName, value, cru);
}
return (value);