use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo in project pinpoint by naver.
the class JoinActiveTraceSampler method sampleDataPoints.
@Override
public AggreJoinActiveTraceBo sampleDataPoints(int index, long timestamp, List<JoinActiveTraceBo> joinActiveTraceBoList, JoinActiveTraceBo previousDataPoint) {
if (CollectionUtils.isEmpty(joinActiveTraceBoList)) {
return AggreJoinActiveTraceBo.createUncollectedObject(timestamp);
}
JoinActiveTraceBo joinActiveTraceBo = JoinActiveTraceBo.joinActiveTraceBoList(joinActiveTraceBoList, timestamp);
String id = joinActiveTraceBo.getId();
int histogramSchemaType = joinActiveTraceBo.getHistogramSchemaType();
short version = joinActiveTraceBo.getVersion();
JoinIntFieldBo totalCountValue = joinActiveTraceBo.getTotalCountJoinValue();
AggreJoinActiveTraceBo aggreJoinActiveTraceBo = new AggreJoinActiveTraceBo(id, histogramSchemaType, version, totalCountValue, timestamp);
return aggreJoinActiveTraceBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo in project pinpoint by naver.
the class JoinThriftActiveTraceBoMapperTest method map2Test.
@Test
public void map2Test() {
final TFAgentStat tFAgentStat = new TFAgentStat();
final String id = "testAgent";
tFAgentStat.setAgentId(id);
tFAgentStat.setTimestamp(1491274148454L);
final JoinActiveTraceBoMapper joinActiveTraceBoMapper = new JoinActiveTraceBoMapper();
final JoinActiveTraceBo joinActiveTraceBo = joinActiveTraceBoMapper.map(tFAgentStat);
assertEquals(joinActiveTraceBo, JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo in project pinpoint by naver.
the class ActiveTraceCodecTest method createJoinActiveTRaceBoList.
private List<JoinStatBo> createJoinActiveTRaceBoList(long currentTime) {
final String id = "test_app";
List<JoinStatBo> joinActiveTraceBoList = new ArrayList<JoinStatBo>();
JoinActiveTraceBo joinActiveTraceBo1 = new JoinActiveTraceBo(id, 1, (short) 2, 31, 11, "app_1_1", 41, "app_1_2", currentTime);
JoinActiveTraceBo joinActiveTraceBo2 = new JoinActiveTraceBo(id, 1, (short) 2, 32, 12, "app_2_1", 42, "app_2_2", currentTime + 5000);
JoinActiveTraceBo joinActiveTraceBo3 = new JoinActiveTraceBo(id, 1, (short) 2, 33, 13, "app_3_1", 43, "app_3_2", currentTime + 10000);
JoinActiveTraceBo joinActiveTraceBo4 = new JoinActiveTraceBo(id, 1, (short) 2, 34, 14, "app_4_1", 44, "app_4_2", currentTime + 15000);
JoinActiveTraceBo joinActiveTraceBo5 = new JoinActiveTraceBo(id, 1, (short) 2, 35, 15, "app_5_1", 45, "app_5_2", currentTime + 20000);
joinActiveTraceBoList.add(joinActiveTraceBo1);
joinActiveTraceBoList.add(joinActiveTraceBo2);
joinActiveTraceBoList.add(joinActiveTraceBo3);
joinActiveTraceBoList.add(joinActiveTraceBo4);
joinActiveTraceBoList.add(joinActiveTraceBo5);
return joinActiveTraceBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo in project pinpoint by naver.
the class JoinActiveTraceSamplerTest method createJoinActiveTraceBoList.
private List<JoinActiveTraceBo> createJoinActiveTraceBoList(long currentTime) {
final String id = "test_app";
List<JoinActiveTraceBo> joinActiveTraceBoList = new ArrayList<JoinActiveTraceBo>();
JoinActiveTraceBo joinActiveTraceBo1 = new JoinActiveTraceBo(id, 1, (short) 2, 150, 10, "app_1_1", 230, "app_1_2", currentTime);
JoinActiveTraceBo joinActiveTraceBo2 = new JoinActiveTraceBo(id, 1, (short) 2, 110, 22, "app_2_1", 330, "app_2_2", currentTime + 5000);
JoinActiveTraceBo joinActiveTraceBo3 = new JoinActiveTraceBo(id, 1, (short) 2, 120, 24, "app_3_1", 540, "app_3_2", currentTime + 10000);
JoinActiveTraceBo joinActiveTraceBo4 = new JoinActiveTraceBo(id, 1, (short) 2, 130, 25, "app_4_1", 560, "app_4_2", currentTime + 15000);
JoinActiveTraceBo joinActiveTraceBo5 = new JoinActiveTraceBo(id, 1, (short) 2, 140, 12, "app_5_1", 260, "app_5_2", currentTime + 20000);
joinActiveTraceBoList.add(joinActiveTraceBo1);
joinActiveTraceBoList.add(joinActiveTraceBo2);
joinActiveTraceBoList.add(joinActiveTraceBo3);
joinActiveTraceBoList.add(joinActiveTraceBo4);
joinActiveTraceBoList.add(joinActiveTraceBo5);
return joinActiveTraceBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo in project pinpoint by naver.
the class JoinActiveTraceSamplerTest method sampleDataPointsTest.
@Test
public void sampleDataPointsTest() {
long currentTime = 1487149800000L;
JoinActiveTraceSampler sampler = new JoinActiveTraceSampler();
List<JoinActiveTraceBo> joinActiveTraceBoList = createJoinActiveTraceBoList(currentTime);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo = sampler.sampleDataPoints(1, currentTime, joinActiveTraceBoList, JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO);
assertEquals(aggreJoinActiveTraceBo.getId(), "test_app");
assertEquals(aggreJoinActiveTraceBo.getHistogramSchemaType(), 1);
assertEquals(aggreJoinActiveTraceBo.getVersion(), 2);
assertEquals(aggreJoinActiveTraceBo.getTotalCountJoinValue(), new JoinIntFieldBo(130, 10, "app_1_1", 560, "app_4_2"));
assertEquals(aggreJoinActiveTraceBo.getTimestamp(), 1487149800000L);
}
Aggregations