httpResponse.println(formatter.toString());
}
private String handleNodeDetails()
{
HTMLFormatter formatter = new HTMLFormatter();
formatter.appendLine(storageService_.getToken());
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
formatter.appendLine("Up time (in seconds): " + (runtimeMxBean.getUptime()/1000));
MemoryMXBean memoryMxBean = ManagementFactory.getMemoryMXBean();
MemoryUsage memUsage = memoryMxBean.getHeapMemoryUsage();
java.text.DecimalFormat df = new java.text.DecimalFormat("#0.00");
String smemUsed = df.format((double)memUsage.getUsed()/(1024 * 1024));
String smemMax = df.format((double)memUsage.getMax()/(1024 * 1024));
formatter.appendLine("Heap memory usage (in MB): " + smemUsed + "/" + smemMax);
formatter.appendLine("<br>");
formatter.appendLine("<br>");
/*
* Display DB statatics if we have something to show.
*/
displayDBStatistics(formatter, df);
formatter.appendLine("<button onClick=\"window.location='" + StorageService.getHostUrl() + "?" + LOADME + "=T'\">Load Me</button>");
formatter.appendLine("<button onClick=\"window.location='" + StorageService.getHostUrl() + "?" + COMPACTME + "=T'\">Compact Me</button>");
formatter.appendLine("<button onClick=\"window.location='" + StorageService.getHostUrl() + "?" + KILLME + "=T'\">Kill Me</button>");
formatter.appendLine("<br>");
formatter.appendLine("<br><a href='" + StorageService.getHostUrl() + "'>Back to live nodes list" + "</a>");
return formatter.toString();
}