use of com.alibaba.cobar.manager.dataobject.cobarnode.ThreadPoolStatus in project cobar by alibaba.
the class CobarNodeInstantPerfValueAjax method listThreadPool.
/**
* ThreadPool Tab
*
* @param params
* @return
*/
private List<Map<String, Object>> listThreadPool(AjaxParams params) {
CobarAdapterDAO perfAccesser = cobarAccesser.getAccesser(params.getCobarNodeId());
if (!perfAccesser.checkConnection()) {
return null;
}
List<ThreadPoolStatus> pools = perfAccesser.listThreadPoolStatus();
List<Map<String, Object>> returnList = new ArrayList<Map<String, Object>>();
for (ThreadPoolStatus t : pools) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("threadPoolName", t.getThreadPoolName());
map.put("poolSize", t.getPoolSize());
map.put("activeSize", t.getActiveSize());
map.put("taskQueue", t.getTaskQueue());
map.put("completedTask", FormatUtil.formatNumber(t.getCompletedTask()));
map.put("totalTask", FormatUtil.formatNumber(t.getTotalTask()));
returnList.add(map);
}
return returnList;
}
Aggregations