final Map<String, AGlobalDataPoint> allData = new TreeMap<String, AGlobalDataPoint>(getSysMon().getGlobalMeasurements());
out.println("<table class='global-measurements'>");
// special handling for system load
final AGlobalDataPoint load1 = allData.remove(ASystemLoadMeasurer.IDENT_LOAD_1_MIN);
final AGlobalDataPoint load5 = allData.remove(ASystemLoadMeasurer.IDENT_LOAD_5_MIN);
final AGlobalDataPoint load15 = allData.remove(ASystemLoadMeasurer.IDENT_LOAD_15_MIN);
final String sLoad1 = load1 != null ? getDecimalFormat(load1. getNumFracDigits()).format(load1. getValue()) : "N/A";
final String sLoad5 = load5 != null ? getDecimalFormat(load5. getNumFracDigits()).format(load5. getValue()) : "N/A";
final String sLoad15 = load15 != null ? getDecimalFormat(load15.getNumFracDigits()).format(load15.getValue()) : "N/A";
//TODO color code system load
writeGlobalMeasurement(out, "System Load", sLoad1 + " / " + sLoad5 + " / " + sLoad15);
// special handling for memory
final AGlobalDataPoint memUsed = allData.remove(AMemoryMeasurer.IDENT_MEM_USED);
final AGlobalDataPoint memTotal = allData.remove(AMemoryMeasurer.IDENT_MEM_TOTAL);
final AGlobalDataPoint memMax = allData.remove(AMemoryMeasurer.IDENT_MEM_MAX);
allData.remove(AMemoryMeasurer.IDENT_MEM_FREE);
final int MEGA = 1024*1024;
final String sMemUsed = memUsed != null ? (getDecimalFormat(memUsed. getNumFracDigits()).format(memUsed. getValue() / MEGA) + "M") : "N/A";
final String sMemTotal = memTotal != null ? (getDecimalFormat(memTotal.getNumFracDigits()).format(memTotal.getValue() / MEGA) + "M") : "N/A";
final String sMemMax = memMax != null ? (getDecimalFormat(memMax. getNumFracDigits()).format(memMax. getValue() / MEGA) + "M") : "N/A";
//TODO color code memory usage
writeGlobalMeasurement(out, "Memory", sMemUsed + " / " + sMemTotal + " / " + sMemMax);