use of com.navercorp.pinpoint.web.vo.AgentActiveThreadCountList in project pinpoint by naver.
the class ActiveThreadCountResponseAggregator method flush.
@Override
public void flush(Executor executor) throws Exception {
if ((flushCount.getAndIncrement() % LOG_RECORD_RATE) == 0) {
logger.info("flush started. applicationName:{}", applicationName);
}
if (isStopped) {
return;
}
AgentActiveThreadCountList response = new AgentActiveThreadCountList();
synchronized (aggregatorLock) {
for (ActiveThreadCountWorker activeThreadCountWorker : activeThreadCountWorkerRepository.values()) {
String agentId = activeThreadCountWorker.getAgentId();
AgentActiveThreadCount agentActiveThreadCount = activeThreadCountMap.get(agentId);
if (agentActiveThreadCount != null) {
response.add(agentActiveThreadCount);
} else {
response.add(activeThreadCountWorker.getDefaultFailResponse());
}
}
activeThreadCountMap = new HashMap<>(activeThreadCountWorkerRepository.size());
}
TextMessage webSocketTextMessage = createWebSocketTextMessage(response);
if (webSocketTextMessage != null) {
if (executor == null) {
flush0(webSocketTextMessage);
} else {
flushAsync0(webSocketTextMessage, executor);
}
}
}
use of com.navercorp.pinpoint.web.vo.AgentActiveThreadCountList in project pinpoint by naver.
the class AgentServiceImpl method getActiveThreadCount.
@Override
public AgentActiveThreadCountList getActiveThreadCount(List<AgentInfo> agentInfoList, byte[] payload) throws TException {
AgentActiveThreadCountList activeThreadCountList = new AgentActiveThreadCountList(agentInfoList.size());
Map<AgentInfo, PinpointRouteResponse> responseList = invoke(agentInfoList, payload);
for (Map.Entry<AgentInfo, PinpointRouteResponse> entry : responseList.entrySet()) {
AgentInfo agentInfo = entry.getKey();
PinpointRouteResponse response = entry.getValue();
AgentActiveThreadCount activeThreadCount = createActiveThreadCount(agentInfo.getAgentId(), response);
activeThreadCountList.add(activeThreadCount);
}
return activeThreadCountList;
}
Aggregations