Search in sources :

Example 1 with JoinResponseTimeBo

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

the class JoinResponseTimeBoMapper method build.

@Override
public void build(TFAgentStat tFAgentStat, JoinAgentStatBo.Builder builder) {
    JoinResponseTimeBo joinResponseTimeBo = this.map(tFAgentStat);
    if (joinResponseTimeBo == joinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO) {
        return;
    }
    builder.addResponseTime(joinResponseTimeBo);
}
Also used : JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo)

Example 2 with JoinResponseTimeBo

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

the class JoinResponseTimeBoMapper method map.

public JoinResponseTimeBo map(TFAgentStat tFAgentStat) {
    if (!tFAgentStat.isSetResponseTime()) {
        return JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO;
    }
    final String agentId = tFAgentStat.getAgentId();
    final TFResponseTime tFResponseTime = tFAgentStat.getResponseTime();
    final long avg = tFResponseTime.getAvg();
    JoinResponseTimeBo joinResponseTimeBo = new JoinResponseTimeBo();
    joinResponseTimeBo.setId(agentId);
    joinResponseTimeBo.setTimestamp(tFAgentStat.getTimestamp());
    joinResponseTimeBo.setResponseTimeJoinValue(new JoinLongFieldBo(avg, avg, agentId, avg, agentId));
    return joinResponseTimeBo;
}
Also used : JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFResponseTime(com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime)

Example 3 with JoinResponseTimeBo

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

the class JoinAgentStatBoMapperTest method map5Test.

@Test
public void map5Test() {
    final String agentId = "testAgent";
    final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
    final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
    tFAgentStatBatch.setStartTimestamp(1491274138454L);
    tFAgentStatBatch.setAgentId(agentId);
    final TFResponseTime tFResponseTime = new TFResponseTime();
    tFResponseTime.setAvg(100);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(agentId);
    tFAgentStat.setTimestamp(1491274148454L);
    tFAgentStat.setResponseTime(tFResponseTime);
    final TFResponseTime tFResponseTime2 = new TFResponseTime();
    tFResponseTime2.setAvg(120);
    final TFAgentStat tFAgentStat2 = new TFAgentStat();
    tFAgentStat2.setAgentId(agentId);
    tFAgentStat2.setTimestamp(1491275148454L);
    tFAgentStat2.setResponseTime(tFResponseTime2);
    final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
    tFAgentStatList.add(tFAgentStat);
    tFAgentStatList.add(tFAgentStat2);
    tFAgentStatBatch.setAgentStats(tFAgentStatList);
    JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
    assertEquals(joinAgentStatBo.getId(), agentId);
    assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274138454L);
    assertEquals(joinAgentStatBo.getTimestamp(), 1491274148454L);
    List<JoinResponseTimeBo> joinResponseTimeBoList = joinAgentStatBo.getJoinResponseTimeBoList();
    assertEquals(joinResponseTimeBoList.size(), 2);
    JoinResponseTimeBo joinResponseTimeBo = joinResponseTimeBoList.get(0);
    assertEquals(joinResponseTimeBo.getId(), agentId);
    assertEquals(joinResponseTimeBo.getTimestamp(), 1491274148454L);
    assertEquals(joinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId));
    JoinResponseTimeBo joinResponseTimeBo2 = joinResponseTimeBoList.get(1);
    assertEquals(joinResponseTimeBo2.getId(), agentId);
    assertEquals(joinResponseTimeBo2.getTimestamp(), 1491275148454L);
    assertEquals(joinResponseTimeBo2.getResponseTimeJoinValue(), new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId));
}
Also used : JoinAgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo) JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFResponseTime(com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch) Test(org.junit.Test)

Example 4 with JoinResponseTimeBo

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

the class JoinResponseTimeSamplerTest method sampleDataPoints2Test.

@Test
public void sampleDataPoints2Test() {
    long currentTime = 1487149800000L;
    JoinResponseTimeSampler joinResponseTimeSampler = new JoinResponseTimeSampler();
    List<JoinResponseTimeBo> joinResponseTimeBoList = new ArrayList<JoinResponseTimeBo>();
    AggreJoinResponseTimeBo aggreJoinResponseTimeBo = joinResponseTimeSampler.sampleDataPoints(1, currentTime, joinResponseTimeBoList, JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO);
    assertEquals(aggreJoinResponseTimeBo.getId(), JoinResponseTimeBo.UNKNOWN_ID);
    assertEquals(aggreJoinResponseTimeBo.getTimestamp(), 1487149800000L);
    assertEquals(aggreJoinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(JoinResponseTimeBo.UNCOLLECTED_VALUE, JoinResponseTimeBo.UNCOLLECTED_VALUE, JoinResponseTimeBo.UNKNOWN_AGENT, JoinResponseTimeBo.UNCOLLECTED_VALUE, JoinResponseTimeBo.UNKNOWN_AGENT));
}
Also used : JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo) AggreJoinResponseTimeBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo) AggreJoinResponseTimeBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo) ArrayList(java.util.ArrayList) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Example 5 with JoinResponseTimeBo

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

the class JoinResponseTimeSamplerTest method createJoinResponseTimeList.

private List<JoinResponseTimeBo> createJoinResponseTimeList(long currentTime) {
    final String id = "test_app";
    List<JoinResponseTimeBo> joinResponseTimeBoList = new ArrayList<JoinResponseTimeBo>();
    JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo(id, currentTime, 3000, 2, "app_1_1", 6000, "app_1_1");
    JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo(id, currentTime + 5000, 4000, 200, "app_2_1", 9000, "app_2_1");
    JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo(id, currentTime + 10000, 2000, 20, "app_3_1", 7000, "app_3_1");
    JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo(id, currentTime + 15000, 5000, 20, "app_4_1", 8000, "app_4_1");
    JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo(id, currentTime + 20000, 1000, 10, "app_5_1", 6600, "app_5_1");
    joinResponseTimeBoList.add(joinResponseTimeBo1);
    joinResponseTimeBoList.add(joinResponseTimeBo2);
    joinResponseTimeBoList.add(joinResponseTimeBo3);
    joinResponseTimeBoList.add(joinResponseTimeBo4);
    joinResponseTimeBoList.add(joinResponseTimeBo5);
    return joinResponseTimeBoList;
}
Also used : JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo) AggreJoinResponseTimeBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo) ArrayList(java.util.ArrayList)

Aggregations

JoinResponseTimeBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo)12 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)7 ArrayList (java.util.ArrayList)6 Test (org.junit.Test)5 TFResponseTime (com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime)4 AggreJoinResponseTimeBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo)4 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)3 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)3 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 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)1 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)1