averageTimes.put(key, average);
}
//System.out.println(SystemTime.getCurrentTime() + "] Refresh " + ttl + "ms");
UIFunctionsSWT uiFunctionsSWT = UIFunctionsManagerSWT.getUIFunctionsSWT();
MainStatusBar mainStatusBar = uiFunctionsSWT == null ? null : uiFunctionsSWT.getMainStatusBar();
if (mainStatusBar != null && mainStatusBar.isMouseOver()) {
StringBuffer sb = new StringBuffer();
for (Iterator iter = averageTimes.keySet().iterator(); iter.hasNext();) {
Object key = iter.next();
Object[] average = (Object[]) averageTimes.get(key);
long lLastUpdated = ((Long) average[IDX_TIME]).longValue();
if (System.currentTimeMillis() - lLastUpdated > 10000) {
iter.remove();
continue;
}
long lTime = ((Long) average[IDX_AVG]).longValue();
if (lTime > 0) {
if (sb.length() > 0)
sb.append("\n");
sb.append(lTime * 100 / waitTimeMS);
sb.append("% ");
sb.append(lTime + "ms avg: ");
sb.append("[" + ((UIUpdatable) key).getUpdateUIName() + "]");
sb.append(average[IDX_SIZE] + " samples");
sb.append("; max:" + average[IDX_MAX]);
sb.append("; last:" + average[IDX_LAST]);
}
}
mainStatusBar.setDebugInfo(sb.toString());
}
}