use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo in project pinpoint by naver.
the class JoinResponseTimeBoMapper method build.
@Override
public void build(TFAgentStat tFAgentStat, JoinAgentStatBo.Builder builder) {
JoinResponseTimeBo joinResponseTimeBo = this.map(tFAgentStat);
if (joinResponseTimeBo == joinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO) {
return;
}
builder.addResponseTime(joinResponseTimeBo);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo in project pinpoint by naver.
the class JoinResponseTimeBoMapper method map.
public JoinResponseTimeBo map(TFAgentStat tFAgentStat) {
if (!tFAgentStat.isSetResponseTime()) {
return JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO;
}
final String agentId = tFAgentStat.getAgentId();
final TFResponseTime tFResponseTime = tFAgentStat.getResponseTime();
final long avg = tFResponseTime.getAvg();
JoinResponseTimeBo joinResponseTimeBo = new JoinResponseTimeBo();
joinResponseTimeBo.setId(agentId);
joinResponseTimeBo.setTimestamp(tFAgentStat.getTimestamp());
joinResponseTimeBo.setResponseTimeJoinValue(new JoinLongFieldBo(avg, avg, agentId, avg, agentId));
return joinResponseTimeBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo in project pinpoint by naver.
the class JoinAgentStatBoMapperTest method map5Test.
@Test
public void map5Test() {
final String agentId = "testAgent";
final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274138454L);
tFAgentStatBatch.setAgentId(agentId);
final TFResponseTime tFResponseTime = new TFResponseTime();
tFResponseTime.setAvg(100);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(agentId);
tFAgentStat.setTimestamp(1491274148454L);
tFAgentStat.setResponseTime(tFResponseTime);
final TFResponseTime tFResponseTime2 = new TFResponseTime();
tFResponseTime2.setAvg(120);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(agentId);
tFAgentStat2.setTimestamp(1491275148454L);
tFAgentStat2.setResponseTime(tFResponseTime2);
final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
tFAgentStatList.add(tFAgentStat);
tFAgentStatList.add(tFAgentStat2);
tFAgentStatBatch.setAgentStats(tFAgentStatList);
JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
assertEquals(joinAgentStatBo.getId(), agentId);
assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274138454L);
assertEquals(joinAgentStatBo.getTimestamp(), 1491274148454L);
List<JoinResponseTimeBo> joinResponseTimeBoList = joinAgentStatBo.getJoinResponseTimeBoList();
assertEquals(joinResponseTimeBoList.size(), 2);
JoinResponseTimeBo joinResponseTimeBo = joinResponseTimeBoList.get(0);
assertEquals(joinResponseTimeBo.getId(), agentId);
assertEquals(joinResponseTimeBo.getTimestamp(), 1491274148454L);
assertEquals(joinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId));
JoinResponseTimeBo joinResponseTimeBo2 = joinResponseTimeBoList.get(1);
assertEquals(joinResponseTimeBo2.getId(), agentId);
assertEquals(joinResponseTimeBo2.getTimestamp(), 1491275148454L);
assertEquals(joinResponseTimeBo2.getResponseTimeJoinValue(), new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId));
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo in project pinpoint by naver.
the class JoinResponseTimeSamplerTest method sampleDataPoints2Test.
@Test
public void sampleDataPoints2Test() {
long currentTime = 1487149800000L;
JoinResponseTimeSampler joinResponseTimeSampler = new JoinResponseTimeSampler();
List<JoinResponseTimeBo> joinResponseTimeBoList = new ArrayList<JoinResponseTimeBo>();
AggreJoinResponseTimeBo aggreJoinResponseTimeBo = joinResponseTimeSampler.sampleDataPoints(1, currentTime, joinResponseTimeBoList, JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO);
assertEquals(aggreJoinResponseTimeBo.getId(), JoinResponseTimeBo.UNKNOWN_ID);
assertEquals(aggreJoinResponseTimeBo.getTimestamp(), 1487149800000L);
assertEquals(aggreJoinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(JoinResponseTimeBo.UNCOLLECTED_VALUE, JoinResponseTimeBo.UNCOLLECTED_VALUE, JoinResponseTimeBo.UNKNOWN_AGENT, JoinResponseTimeBo.UNCOLLECTED_VALUE, JoinResponseTimeBo.UNKNOWN_AGENT));
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo in project pinpoint by naver.
the class JoinResponseTimeSamplerTest method createJoinResponseTimeList.
private List<JoinResponseTimeBo> createJoinResponseTimeList(long currentTime) {
final String id = "test_app";
List<JoinResponseTimeBo> joinResponseTimeBoList = new ArrayList<JoinResponseTimeBo>();
JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo(id, currentTime, 3000, 2, "app_1_1", 6000, "app_1_1");
JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo(id, currentTime + 5000, 4000, 200, "app_2_1", 9000, "app_2_1");
JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo(id, currentTime + 10000, 2000, 20, "app_3_1", 7000, "app_3_1");
JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo(id, currentTime + 15000, 5000, 20, "app_4_1", 8000, "app_4_1");
JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo(id, currentTime + 20000, 1000, 10, "app_5_1", 6600, "app_5_1");
joinResponseTimeBoList.add(joinResponseTimeBo1);
joinResponseTimeBoList.add(joinResponseTimeBo2);
joinResponseTimeBoList.add(joinResponseTimeBo3);
joinResponseTimeBoList.add(joinResponseTimeBo4);
joinResponseTimeBoList.add(joinResponseTimeBo5);
return joinResponseTimeBoList;
}
Aggregations