Search in sources :

Example 6 with JoinResponseTimeBo

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

the class JoinResponseTimeSampler method sampleDataPoints.

@Override
public AggreJoinResponseTimeBo sampleDataPoints(int index, long timestamp, List<JoinResponseTimeBo> joinResponseTimeBoList, JoinResponseTimeBo previousDataPoint) {
    if (CollectionUtils.isEmpty(joinResponseTimeBoList)) {
        return AggreJoinResponseTimeBo.createUncollectedObject(timestamp);
    }
    JoinResponseTimeBo joinResponseTimeBo = JoinResponseTimeBo.joinResponseTimeBoList(joinResponseTimeBoList, timestamp);
    String id = joinResponseTimeBo.getId();
    JoinLongFieldBo responseTimeJoinValue = joinResponseTimeBo.getResponseTimeJoinValue();
    AggreJoinResponseTimeBo aggreJoinResponseTimeBo = new AggreJoinResponseTimeBo(id, timestamp, responseTimeJoinValue);
    return aggreJoinResponseTimeBo;
}
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) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Example 7 with JoinResponseTimeBo

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

Example 8 with JoinResponseTimeBo

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

the class JoinResponseTimeSamplerTest method sampleDataPointsTest.

@Test
public void sampleDataPointsTest() {
    long currentTime = 1487149800000L;
    JoinResponseTimeSampler joinResponseTimeSampler = new JoinResponseTimeSampler();
    List<JoinResponseTimeBo> joinResponseTimeBoList = createJoinResponseTimeList(currentTime);
    AggreJoinResponseTimeBo aggreJoinResponseTimeBo = joinResponseTimeSampler.sampleDataPoints(1, currentTime, joinResponseTimeBoList, JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO);
    assertEquals(aggreJoinResponseTimeBo.getId(), "test_app");
    assertEquals(aggreJoinResponseTimeBo.getTimestamp(), 1487149800000L);
    assertEquals(aggreJoinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(3000L, 2L, "app_1_1", 9000L, "app_2_1"));
}
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) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Example 9 with JoinResponseTimeBo

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

the class ResponseTimeCodec method encodeValues.

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

Example 10 with JoinResponseTimeBo

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

the class ResponseTimeCodec method decodeValues.

@Override
public List<JoinStatBo> decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) {
    final String id = decodingContext.getApplicationId();
    final long baseTimestamp = decodingContext.getBaseTimestamp();
    final long timestampDelta = decodingContext.getTimestampDelta();
    final long initialTimestamp = baseTimestamp + timestampDelta;
    int numValues = valueBuffer.readVInt();
    List<Long> timestampList = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    JoinLongFieldEncodingStrategy responseTimeEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
    final List<JoinLongFieldBo> responseTimeList = this.codec.decodeValues(valueBuffer, responseTimeEncodingStrategy, numValues);
    List<JoinStatBo> joinResponseTimeBoList = new ArrayList<JoinStatBo>();
    for (int i = 0; i < numValues; i++) {
        JoinResponseTimeBo joinResponseTimeBo = new JoinResponseTimeBo();
        joinResponseTimeBo.setId(id);
        joinResponseTimeBo.setTimestamp(timestampList.get(i));
        joinResponseTimeBo.setResponseTimeJoinValue(responseTimeList.get(i));
        joinResponseTimeBoList.add(joinResponseTimeBo);
    }
    return joinResponseTimeBoList;
}
Also used : BitCountingHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder) ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinLongFieldEncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) AgentStatHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder) JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo)

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