mirror of https://github.com/apache/cloudstack.git
Do load report outside of the loop
This commit is contained in:
parent
85b35978de
commit
12ec170cc0
|
|
@ -113,7 +113,7 @@ public class ConsoleProxyAjaxHandler implements HttpHandler {
|
|||
viewer = ConsoleProxy.getAjaxVncViewer(host, port, sid, tag, ticket, ajaxSessionIdStr);
|
||||
} catch(Exception e) {
|
||||
|
||||
s_logger.warn("Failed to create viwer due to " + e.getMessage(), e);
|
||||
s_logger.warn("Failed to create viewer due to " + e.getMessage(), e);
|
||||
|
||||
String[] content = new String[] {
|
||||
"<html><head></head><body>",
|
||||
|
|
|
|||
|
|
@ -58,9 +58,12 @@ public class ConsoleProxyGCThread extends Thread {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
public void run() {
|
||||
|
||||
boolean bReportLoad = false;
|
||||
while (true) {
|
||||
cleanupLogging();
|
||||
cleanupLogging();
|
||||
bReportLoad = false;
|
||||
|
||||
s_logger.info("connMap=" + connMap);
|
||||
Enumeration<String> e = connMap.keys();
|
||||
|
|
@ -85,13 +88,15 @@ public class ConsoleProxyGCThread extends Thread {
|
|||
// close the server connection
|
||||
s_logger.info("Dropping " + client + " which has not been used for " + seconds_unused + " seconds");
|
||||
client.closeClient();
|
||||
|
||||
// report load changes
|
||||
String loadInfo = new ConsoleProxyClientStatsCollector(connMap).getStatsReport();
|
||||
ConsoleProxy.reportLoadInfo(loadInfo);
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Report load change : " + loadInfo);
|
||||
}
|
||||
}
|
||||
|
||||
if(bReportLoad) {
|
||||
// report load changes
|
||||
String loadInfo = new ConsoleProxyClientStatsCollector(connMap).getStatsReport();
|
||||
ConsoleProxy.reportLoadInfo(loadInfo);
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Report load change : " + loadInfo);
|
||||
}
|
||||
|
||||
try { Thread.sleep(1000); } catch (InterruptedException ex) {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue