use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class LoadedClassCountCodecTest method encodeAndDecodeTest.
@Test
public void encodeAndDecodeTest() {
final String id = "test_app";
final long currentTime = new Date().getTime();
final AgentStatDataPointCodec agentStatDataPointCodec = new AgentStatDataPointCodec();
final LoadedClassCodec loadedClassCodec = new LoadedClassCodec(agentStatDataPointCodec);
final Buffer encodedValueBuffer = new AutomaticBuffer();
final List<JoinStatBo> joinLoadedClassBoList = createJoinLoadedClassCountBoList(currentTime);
encodedValueBuffer.putByte(loadedClassCodec.getVersion());
loadedClassCodec.encodeValues(encodedValueBuffer, joinLoadedClassBoList);
final Buffer valueBuffer = new FixedBuffer(encodedValueBuffer.getBuffer());
;
final long baseTimestamp = AgentStatUtils.getBaseTimestamp(currentTime);
final long timestampDelta = currentTime - baseTimestamp;
final ApplicationStatDecodingContext decodingContext = new ApplicationStatDecodingContext();
decodingContext.setApplicationId(id);
decodingContext.setBaseTimestamp(baseTimestamp);
decodingContext.setTimestampDelta(timestampDelta);
assertEquals(valueBuffer.readByte(), loadedClassCodec.getVersion());
List<JoinStatBo> decodedJoinLoadedClassBoList = loadedClassCodec.decodeValues(valueBuffer, decodingContext);
for (int i = 0; i < decodedJoinLoadedClassBoList.size(); i++) {
assertEquals(decodedJoinLoadedClassBoList.get(i), joinLoadedClassBoList.get(i));
}
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class LoadedClassCountCodecTest method createJoinLoadedClassCountBoList.
private List<JoinStatBo> createJoinLoadedClassCountBoList(long currentTime) {
final String id = "test_app";
final List<JoinStatBo> joinLoadedClassBoList = new ArrayList<>();
JoinLoadedClassBo joinLoadedClassBo1 = new JoinLoadedClassBo(id, 80, 900, "agent2_1", 20, "agent2_2", 70, 900, "agent2_1", 20, "agent2_2", currentTime);
JoinLoadedClassBo joinLoadedClassBo2 = new JoinLoadedClassBo(id, 70, 900, "agent2_1", 20, "agent2_2", 70, 900, "agent2_1", 20, "agent2_2", currentTime + 5000);
JoinLoadedClassBo joinLoadedClassBo3 = new JoinLoadedClassBo(id, 60, 800, "agent4_1", 15, "agent4_2", 60, 800, "agent4_1", 15, "agent4_2", currentTime + 15000);
JoinLoadedClassBo joinLoadedClassBo4 = new JoinLoadedClassBo(id, 50, 700, "agent3_1", 10, "agent3_2", 50, 700, "agent3_1", 10, "agent3_2", currentTime + 10000);
JoinLoadedClassBo joinLoadedClassBo5 = new JoinLoadedClassBo(id, 40, 600, "agent5_1", 5, "agent5_2", 40, 600, "agent5_1", 5, "agent5_2", currentTime + 20000);
joinLoadedClassBoList.add(joinLoadedClassBo1);
joinLoadedClassBoList.add(joinLoadedClassBo2);
joinLoadedClassBoList.add(joinLoadedClassBo3);
joinLoadedClassBoList.add(joinLoadedClassBo4);
joinLoadedClassBoList.add(joinLoadedClassBo5);
return joinLoadedClassBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class ResponseTimeCodecTest method createJoinResponseTimeBoList.
private List<JoinStatBo> createJoinResponseTimeBoList(long currentTime) {
final String id = "test_app";
List<JoinStatBo> joinResponseTimeBoList = new ArrayList<>();
JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo(id, currentTime, 3000, 2, "app_1_1", 6000, "app_1_2");
JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo(id, currentTime + 5000, 4000, 200, "app_2_1", 9000, "app_2_2");
JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo(id, currentTime + 10000, 2000, 20, "app_3_1", 7000, "app_3_2");
JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo(id, currentTime + 15000, 5000, 20, "app_4_1", 8000, "app_4_2");
JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo(id, currentTime + 20000, 1000, 10, "app_5_1", 6600, "app_5_2");
joinResponseTimeBoList.add(joinResponseTimeBo1);
joinResponseTimeBoList.add(joinResponseTimeBo2);
joinResponseTimeBoList.add(joinResponseTimeBo3);
joinResponseTimeBoList.add(joinResponseTimeBo4);
joinResponseTimeBoList.add(joinResponseTimeBo5);
return joinResponseTimeBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class ResponseTimeCodecTest method encodeAndDecodeTest.
@Test
public void encodeAndDecodeTest() {
final String id = "test_app";
final long currentTime = new Date().getTime();
final AgentStatDataPointCodec agentStatDataPointCodec = new AgentStatDataPointCodec();
final ResponseTimeCodec responseTimeCodec = new ResponseTimeCodec(agentStatDataPointCodec);
final Buffer encodedValueBuffer = new AutomaticBuffer();
final List<JoinStatBo> joinResponseTimeBoList = createJoinResponseTimeBoList(currentTime);
encodedValueBuffer.putByte(responseTimeCodec.getVersion());
responseTimeCodec.encodeValues(encodedValueBuffer, joinResponseTimeBoList);
final Buffer valueBuffer = new FixedBuffer(encodedValueBuffer.getBuffer());
;
final long baseTimestamp = AgentStatUtils.getBaseTimestamp(currentTime);
final long timestampDelta = currentTime - baseTimestamp;
final ApplicationStatDecodingContext decodingContext = new ApplicationStatDecodingContext();
decodingContext.setApplicationId(id);
decodingContext.setBaseTimestamp(baseTimestamp);
decodingContext.setTimestampDelta(timestampDelta);
assertEquals(valueBuffer.readByte(), responseTimeCodec.getVersion());
List<JoinStatBo> decodedJoinResponseTimeBoList = responseTimeCodec.decodeValues(valueBuffer, decodingContext);
for (int i = 0; i < decodedJoinResponseTimeBoList.size(); i++) {
assertEquals(decodedJoinResponseTimeBoList.get(i), joinResponseTimeBoList.get(i));
}
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class FileDescriptorCodecTest method createJoinFileDescriptorBoList.
private List<JoinStatBo> createJoinFileDescriptorBoList(long currentTime) {
final String id = "test_app";
final List<JoinStatBo> joinFileDescriptorBoList = new ArrayList<>();
JoinFileDescriptorBo joinFileDescriptorBo1 = new JoinFileDescriptorBo(id, 80, 1000, "agent1_1", 30, "agent1_2", currentTime);
JoinFileDescriptorBo joinFileDescriptorBo2 = new JoinFileDescriptorBo(id, 70, 900, "agent2_1", 20, "agent2_2", currentTime + 5000);
JoinFileDescriptorBo joinFileDescriptorBo4 = new JoinFileDescriptorBo(id, 60, 800, "agent4_1", 15, "agent4_2", currentTime + 15000);
JoinFileDescriptorBo joinFileDescriptorBo3 = new JoinFileDescriptorBo(id, 50, 700, "agent3_1", 10, "agent3_2", currentTime + 10000);
JoinFileDescriptorBo joinFileDescriptorBo5 = new JoinFileDescriptorBo(id, 40, 600, "agent5_1", 5, "agent5_2", currentTime + 20000);
joinFileDescriptorBoList.add(joinFileDescriptorBo1);
joinFileDescriptorBoList.add(joinFileDescriptorBo2);
joinFileDescriptorBoList.add(joinFileDescriptorBo3);
joinFileDescriptorBoList.add(joinFileDescriptorBo4);
joinFileDescriptorBoList.add(joinFileDescriptorBo5);
return joinFileDescriptorBoList;
}
Aggregations