use of com.navercorp.pinpoint.common.server.bo.AgentStatCpuLoadBo in project pinpoint by naver.
the class AgentStatCpuLoadBoTest method testByteArrayConversion.
@Test
public void testByteArrayConversion() {
// Given
final AgentStatCpuLoadBo testBo = createTestBo(0.22871734201908112D, 0.23790152370929718D);
// When
final byte[] serializedBo = testBo.writeValue();
final AgentStatCpuLoadBo deserializedBo = new AgentStatCpuLoadBo.Builder(serializedBo).build();
// Then
assertEquals(testBo.getAgentId(), deserializedBo.getAgentId());
assertEquals(testBo.getStartTimestamp(), deserializedBo.getStartTimestamp());
assertEquals(testBo.getTimestamp(), deserializedBo.getTimestamp());
assertEquals(testBo.getJvmCpuLoad(), deserializedBo.getJvmCpuLoad(), DELTA);
assertEquals(testBo.getSystemCpuLoad(), deserializedBo.getSystemCpuLoad(), DELTA);
}
use of com.navercorp.pinpoint.common.server.bo.AgentStatCpuLoadBo in project pinpoint by naver.
the class AgentStatCpuLoadBoTest method testByteArrayConversionEdges.
@Test
public void testByteArrayConversionEdges() {
// Given
final AgentStatCpuLoadBo testBo = createTestBo(Double.MIN_VALUE, Double.MAX_VALUE);
// When
final byte[] serializedBo = testBo.writeValue();
final AgentStatCpuLoadBo deserializedBo = new AgentStatCpuLoadBo.Builder(serializedBo).build();
// Then
assertEquals(testBo.getAgentId(), deserializedBo.getAgentId());
assertEquals(testBo.getStartTimestamp(), deserializedBo.getStartTimestamp());
assertEquals(testBo.getTimestamp(), deserializedBo.getTimestamp());
assertEquals(testBo.getJvmCpuLoad(), deserializedBo.getJvmCpuLoad(), DELTA);
assertEquals(testBo.getSystemCpuLoad(), deserializedBo.getSystemCpuLoad(), DELTA);
}
use of com.navercorp.pinpoint.common.server.bo.AgentStatCpuLoadBo in project pinpoint by naver.
the class LegacyAgentStatMapperTest method createResultForLegacy_serialized_BOs.
private Result createResultForLegacy_serialized_BOs() {
final AgentStatMemoryGcBo.Builder jvmGcBuilder = new AgentStatMemoryGcBo.Builder(AGENT_ID, 0L, TIMESTAMP);
jvmGcBuilder.gcType(GC_TYPE.name());
jvmGcBuilder.jvmGcOldCount(GC_OLD_COUNT);
jvmGcBuilder.jvmGcOldTime(GC_OLD_TIME);
jvmGcBuilder.jvmMemoryHeapUsed(HEAP_USED);
jvmGcBuilder.jvmMemoryHeapMax(HEAP_MAX);
jvmGcBuilder.jvmMemoryNonHeapUsed(NON_HEAP_USED);
jvmGcBuilder.jvmMemoryNonHeapMax(NON_HEAP_MAX);
final AgentStatCpuLoadBo.Builder cpuLoadBuilder = new AgentStatCpuLoadBo.Builder(AGENT_ID, 0L, TIMESTAMP);
cpuLoadBuilder.jvmCpuLoad(JVM_CPU_USAGE);
cpuLoadBuilder.systemCpuLoad(SYS_CPU_USAGE);
final AgentStatMemoryGcBo jvmGc = jvmGcBuilder.build();
final AgentStatCpuLoadBo cpuLoad = cpuLoadBuilder.build();
final Cell jvmGcCell = createCell(AGENT_STAT_CF_STATISTICS_MEMORY_GC, jvmGc.writeValue());
final Cell cpuLoadCell = createCell(AGENT_STAT_CF_STATISTICS_CPU_LOAD, cpuLoad.writeValue());
return Result.create(Arrays.asList(jvmGcCell, cpuLoadCell));
}
use of com.navercorp.pinpoint.common.server.bo.AgentStatCpuLoadBo in project pinpoint by naver.
the class AgentStatCpuLoadBoTest method testByteArrayConversionInfiniteValues.
@Test
public void testByteArrayConversionInfiniteValues() {
// Given
final AgentStatCpuLoadBo testBo = createTestBo(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY);
// When
final byte[] serializedBo = testBo.writeValue();
final AgentStatCpuLoadBo deserializedBo = new AgentStatCpuLoadBo.Builder(serializedBo).build();
// Then
assertEquals(testBo.getAgentId(), deserializedBo.getAgentId());
assertEquals(testBo.getStartTimestamp(), deserializedBo.getStartTimestamp());
assertEquals(testBo.getTimestamp(), deserializedBo.getTimestamp());
assertEquals(testBo.getJvmCpuLoad(), deserializedBo.getJvmCpuLoad(), DELTA);
assertEquals(testBo.getSystemCpuLoad(), deserializedBo.getSystemCpuLoad(), DELTA);
}
use of com.navercorp.pinpoint.common.server.bo.AgentStatCpuLoadBo in project pinpoint by naver.
the class AgentStatCpuLoadBoTest method testByteArrayConversionNanValues.
@Test
public void testByteArrayConversionNanValues() {
// Given
final AgentStatCpuLoadBo testBo = createTestBo(Double.NaN, Double.NaN);
// When
final byte[] serializedBo = testBo.writeValue();
final AgentStatCpuLoadBo deserializedBo = new AgentStatCpuLoadBo.Builder(serializedBo).build();
// Then
assertEquals(testBo.getAgentId(), deserializedBo.getAgentId());
assertEquals(testBo.getStartTimestamp(), deserializedBo.getStartTimestamp());
assertEquals(testBo.getTimestamp(), deserializedBo.getTimestamp());
assertEquals(testBo.getJvmCpuLoad(), deserializedBo.getJvmCpuLoad(), DELTA);
assertEquals(testBo.getSystemCpuLoad(), deserializedBo.getSystemCpuLoad(), DELTA);
}
Aggregations