Search in sources :

Example 1 with TFDirectBuffer

use of com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer in project pinpoint by naver.

the class TFDirectBufferMapperTest method mapTest.

@Test
public void mapTest() {
    TFDirectBufferMapper tFDirectBufferMapper = new TFDirectBufferMapper();
    DirectBufferBo directBufferBo = new DirectBufferBo();
    directBufferBo.setDirectCount(30);
    directBufferBo.setDirectMemoryUsed(30);
    directBufferBo.setMappedCount(30);
    directBufferBo.setMappedMemoryUsed(30);
    TFDirectBuffer tFDirectBuffer = tFDirectBufferMapper.map(directBufferBo);
    assertEquals(tFDirectBuffer.getDirectCount(), 30, 0);
    assertEquals(tFDirectBuffer.getDirectMemoryUsed(), 30, 0);
    assertEquals(tFDirectBuffer.getMappedCount(), 30, 0);
    assertEquals(tFDirectBuffer.getMappedMemoryUsed(), 30, 0);
}
Also used : TFDirectBuffer(com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer) DirectBufferBo(com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo) Test(org.junit.Test)

Example 2 with TFDirectBuffer

use of com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer in project pinpoint by naver.

the class TBaseFlatMapperTest method createTFAgentStatBatch5.

private TFAgentStatBatch createTFAgentStatBatch5() {
    final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
    tFAgentStatBatch.setStartTimestamp(1491274142454L);
    tFAgentStatBatch.setAgentId(AGENT_ID);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(AGENT_ID);
    tFAgentStat.setTimestamp(1491274143454L);
    final TFDirectBuffer tFDirectBuffer = new TFDirectBuffer();
    tFDirectBuffer.setDirectCount(10);
    tFDirectBuffer.setDirectMemoryUsed(20);
    tFDirectBuffer.setMappedCount(30);
    tFDirectBuffer.setMappedMemoryUsed(40);
    tFAgentStat.setDirectBuffer(tFDirectBuffer);
    final TFAgentStat tFAgentStat2 = new TFAgentStat();
    tFAgentStat2.setAgentId(AGENT_ID);
    tFAgentStat2.setTimestamp(1491274148454L);
    final TFDirectBuffer tFDirectBuffer2 = new TFDirectBuffer();
    tFDirectBuffer2.setDirectCount(50);
    tFDirectBuffer2.setDirectMemoryUsed(60);
    tFDirectBuffer2.setMappedCount(70);
    tFDirectBuffer2.setMappedMemoryUsed(80);
    tFAgentStat2.setDirectBuffer(tFDirectBuffer2);
    final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
    tFAgentStatList.add(tFAgentStat);
    tFAgentStatList.add(tFAgentStat2);
    tFAgentStatBatch.setAgentStats(tFAgentStatList);
    return tFAgentStatBatch;
}
Also used : TFDirectBuffer(com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)

Example 3 with TFDirectBuffer

use of com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer in project pinpoint by naver.

the class JoinDirectBufferBoMapper method map.

@Override
public JoinDirectBufferBo map(TFAgentStat tFAgentStat) {
    if (!tFAgentStat.isSetDirectBuffer()) {
        return JoinDirectBufferBo.EMPTY_JOIN_DIRECT_BUFFER_BO;
    }
    JoinDirectBufferBo joinDirectBufferBo = new JoinDirectBufferBo();
    final String agentId = tFAgentStat.getAgentId();
    joinDirectBufferBo.setId(agentId);
    joinDirectBufferBo.setTimestamp(tFAgentStat.getTimestamp());
    TFDirectBuffer tFDirectBuffer = tFAgentStat.getDirectBuffer();
    final long directCount = tFDirectBuffer.getDirectCount();
    joinDirectBufferBo.setDirectCountJoinValue(new JoinLongFieldBo(directCount, directCount, agentId, directCount, agentId));
    final long directMemoryUsed = tFDirectBuffer.getDirectMemoryUsed();
    joinDirectBufferBo.setDirectMemoryUsedJoinValue(new JoinLongFieldBo(directMemoryUsed, directMemoryUsed, agentId, directMemoryUsed, agentId));
    final long mappedCount = tFDirectBuffer.getMappedCount();
    joinDirectBufferBo.setMappedCountJoinValue(new JoinLongFieldBo(mappedCount, mappedCount, agentId, mappedCount, agentId));
    final long mappedMemoryUsed = tFDirectBuffer.getMappedMemoryUsed();
    joinDirectBufferBo.setMappedMemoryUsedJoinValue(new JoinLongFieldBo(mappedMemoryUsed, mappedMemoryUsed, agentId, mappedMemoryUsed, agentId));
    return joinDirectBufferBo;
}
Also used : JoinDirectBufferBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDirectBufferBo) TFDirectBuffer(com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Example 4 with TFDirectBuffer

use of com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer in project pinpoint by naver.

the class TFDirectBufferMapper method map.

public TFDirectBuffer map(DirectBufferBo directBufferBo) {
    TFDirectBuffer tfFDirectBuffer = new TFDirectBuffer();
    tfFDirectBuffer.setDirectCount(directBufferBo.getDirectCount());
    tfFDirectBuffer.setDirectMemoryUsed(directBufferBo.getDirectMemoryUsed());
    tfFDirectBuffer.setMappedCount(directBufferBo.getMappedCount());
    tfFDirectBuffer.setMappedMemoryUsed(directBufferBo.getMappedMemoryUsed());
    return tfFDirectBuffer;
}
Also used : TFDirectBuffer(com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer)

Example 5 with TFDirectBuffer

use of com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer in project pinpoint by naver.

the class JoinDirectBufferBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final TFDirectBuffer tfDirectBuffer = new TFDirectBuffer();
    tfDirectBuffer.setDirectCount(10);
    tfDirectBuffer.setDirectMemoryUsed(11);
    tfDirectBuffer.setMappedCount(12);
    tfDirectBuffer.setMappedMemoryUsed(13);
    tFAgentStat.setDirectBuffer(tfDirectBuffer);
    final JoinDirectBufferBoMapper mapper = new JoinDirectBufferBoMapper();
    final JoinDirectBufferBo joinDirectBufferBo = mapper.map(tFAgentStat);
    assertNotNull(joinDirectBufferBo);
    assertEquals(joinDirectBufferBo.getId(), "testAgent");
    assertEquals(joinDirectBufferBo.getTimestamp(), 1491274138454L);
    final JoinLongFieldBo directCountJoinValue = joinDirectBufferBo.getDirectCountJoinValue();
    assertEquals(directCountJoinValue.getAvg(), 10, 0);
    assertEquals(directCountJoinValue.getMin(), 10, 0);
    assertEquals(directCountJoinValue.getMax(), 10, 0);
    final JoinLongFieldBo directMemoryUsedJoinValue = joinDirectBufferBo.getDirectMemoryUsedJoinValue();
    assertEquals(directMemoryUsedJoinValue.getAvg(), 11, 0);
    assertEquals(directMemoryUsedJoinValue.getMin(), 11, 0);
    assertEquals(directMemoryUsedJoinValue.getMax(), 11, 0);
    final JoinLongFieldBo mappedCountJoinValue = joinDirectBufferBo.getMappedCountJoinValue();
    assertEquals(mappedCountJoinValue.getAvg(), 12, 0);
    assertEquals(mappedCountJoinValue.getMin(), 12, 0);
    assertEquals(mappedCountJoinValue.getMax(), 12, 0);
    final JoinLongFieldBo mappedMemoryUsedJoinValue = joinDirectBufferBo.getMappedMemoryUsedJoinValue();
    assertEquals(mappedMemoryUsedJoinValue.getAvg(), 13, 0);
    assertEquals(mappedMemoryUsedJoinValue.getMin(), 13, 0);
    assertEquals(mappedMemoryUsedJoinValue.getMax(), 13, 0);
}
Also used : JoinDirectBufferBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDirectBufferBo) TFDirectBuffer(com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Aggregations

TFDirectBuffer (com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer)5 JoinDirectBufferBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinDirectBufferBo)2 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)2 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)2 Test (org.junit.Test)2 DirectBufferBo (com.navercorp.pinpoint.common.server.bo.stat.DirectBufferBo)1 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)1 ArrayList (java.util.ArrayList)1