use of com.navercorp.pinpoint.web.vo.AgentCountStatistics in project pinpoint by naver.
the class MemoryAgentStatisticsDaoTest method createTestData.
private static List<AgentCountStatistics> createTestData(int size) {
List<AgentCountStatistics> data = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
AgentCountStatistics agentCountStatistics = new AgentCountStatistics(ThreadLocalRandom.current().nextInt(0, Integer.MAX_VALUE), (i * 100) + 100);
data.add(agentCountStatistics);
}
return data;
}
use of com.navercorp.pinpoint.web.vo.AgentCountStatistics in project pinpoint by naver.
the class AgentCountWriter method write.
@Override
public void write(List<? extends AgentCountStatistics> items) throws Exception {
if (items.size() == 1) {
AgentCountStatistics agentCountStatistics = items.get(0);
if (agentCountStatistics == null || agentCountStatistics.getAgentCount() < 0) {
throw new JobExecutionException("Bad parameter");
}
boolean success = agentStatisticsDao.insertAgentCount(agentCountStatistics);
if (!success) {
throw new JobExecutionException("insert AgentCount failed.");
}
} else {
throw new JobExecutionException("Bad parameter");
}
}
Aggregations