Search in sources :

Example 1 with JoinFileDescriptorBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo in project pinpoint by naver.

the class JoinFileDescriptorSampler method sampleDataPoints.

@Override
public AggreJoinFileDescriptorBo sampleDataPoints(int timeWindowIndex, long timestamp, List<JoinFileDescriptorBo> joinFileDescriptorBoList, JoinFileDescriptorBo previousDataPoint) {
    if (CollectionUtils.isEmpty(joinFileDescriptorBoList)) {
        return AggreJoinFileDescriptorBo.createUncollectedObject(timestamp);
    }
    JoinFileDescriptorBo joinFileDescriptorBo = JoinFileDescriptorBo.joinFileDescriptorBoList(joinFileDescriptorBoList, timestamp);
    String id = joinFileDescriptorBo.getId();
    final JoinLongFieldBo openFdCountJoinValue = joinFileDescriptorBo.getOpenFdCountJoinValue();
    AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo = new AggreJoinFileDescriptorBo(id, openFdCountJoinValue, timestamp);
    return aggreJoinFileDescriptorBo;
}
Also used : AggreJoinFileDescriptorBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinFileDescriptorBo) AggreJoinFileDescriptorBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinFileDescriptorBo) JoinFileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Example 2 with JoinFileDescriptorBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo in project pinpoint by naver.

the class JoinFileDescriptorBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final TFFileDescriptor tfFileDescriptor = new TFFileDescriptor();
    tfFileDescriptor.setOpenFileDescriptorCount(10);
    tFAgentStat.setFileDescriptor(tfFileDescriptor);
    final JoinFileDescriptorBoMapper mapper = new JoinFileDescriptorBoMapper();
    final JoinFileDescriptorBo joinFileDescriptorBo = mapper.map(tFAgentStat);
    assertNotNull(joinFileDescriptorBo);
    assertEquals(joinFileDescriptorBo.getId(), "testAgent");
    assertEquals(joinFileDescriptorBo.getTimestamp(), 1491274138454L);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getAvg(), 10, 0);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMin(), 10, 0);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMax(), 10, 0);
}
Also used : TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinFileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo) TFFileDescriptor(com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor) Test(org.junit.Test)

Example 3 with JoinFileDescriptorBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo in project pinpoint by naver.

the class TBaseFlatMapperTest method assertJoinFileDescriptorBo.

private void assertJoinFileDescriptorBo(List<JoinFileDescriptorBo> joinFileDescriptorBoList) {
    assertEquals(2, joinFileDescriptorBoList.size());
    JoinFileDescriptorBo joinFileDescriptorBo = joinFileDescriptorBoList.get(0);
    assertEquals(joinFileDescriptorBo.getId(), AGENT_ID);
    assertEquals(joinFileDescriptorBo.getTimestamp(), 1491274143454L);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getAvg(), 10, 0);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMin(), 10, 0);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMax(), 10, 0);
    joinFileDescriptorBo = joinFileDescriptorBoList.get(1);
    assertEquals(joinFileDescriptorBo.getId(), AGENT_ID);
    assertEquals(joinFileDescriptorBo.getTimestamp(), 1491274148454L);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getAvg(), 20, 0);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMin(), 20, 0);
    assertEquals(joinFileDescriptorBo.getOpenFdCountJoinValue().getMax(), 20, 0);
}
Also used : JoinFileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo)

Example 4 with JoinFileDescriptorBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo 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;
}
Also used : ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinFileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo)

Example 5 with JoinFileDescriptorBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo in project pinpoint by naver.

the class FileDescriptorCodec method encodeValues.

@Override
public void encodeValues(Buffer valueBuffer, List<JoinStatBo> joinFileDescriptorBoList) {
    if (CollectionUtils.isEmpty(joinFileDescriptorBoList)) {
        throw new IllegalArgumentException("fileDescriptorBoList must not be empty");
    }
    final int numValues = joinFileDescriptorBoList.size();
    valueBuffer.putVInt(numValues);
    List<Long> timestamps = new ArrayList<>(numValues);
    JoinLongFieldStrategyAnalyzer.Builder openFileDescriptorCountAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
    for (JoinStatBo joinStatBo : joinFileDescriptorBoList) {
        JoinFileDescriptorBo joinFileDescriptorBo = (JoinFileDescriptorBo) joinStatBo;
        timestamps.add(joinFileDescriptorBo.getTimestamp());
        openFileDescriptorCountAnalyzerBuilder.addValue(joinFileDescriptorBo.getOpenFdCountJoinValue());
    }
    codec.encodeTimestamps(valueBuffer, timestamps);
    encodeDataPoints(valueBuffer, openFileDescriptorCountAnalyzerBuilder.build());
}
Also used : JoinLongFieldStrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldStrategyAnalyzer) ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinFileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo)

Aggregations

JoinFileDescriptorBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo)10 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)4 ArrayList (java.util.ArrayList)4 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)3 Test (org.junit.Test)3 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)2 TFFileDescriptor (com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor)2 AggreJoinFileDescriptorBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinFileDescriptorBo)2 AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)1 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)1 JoinLongFieldEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy)1 JoinLongFieldStrategyAnalyzer (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldStrategyAnalyzer)1 Date (java.util.Date)1