Search in sources :

Example 1 with JoinTotalThreadCountBo

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

the class JoinTotalThreadCountSampler method sampleDataPoints.

@Override
public AggreJoinTotalThreadCountBo sampleDataPoints(int index, long timestamp, List<JoinTotalThreadCountBo> dataPoints, JoinTotalThreadCountBo previousDataPoint) {
    if (CollectionUtils.isEmpty(dataPoints)) {
        return AggreJoinTotalThreadCountBo.createUncollectedObject(timestamp);
    }
    JoinTotalThreadCountBo joinTotalThreadCountBo = JoinTotalThreadCountBo.joinTotalThreadCountBoList(dataPoints, timestamp);
    String id = joinTotalThreadCountBo.getId();
    final JoinLongFieldBo totalThreadCountJoinValue = joinTotalThreadCountBo.getTotalThreadCountJoinValue();
    AggreJoinTotalThreadCountBo aggreJoinTotalThraedCountBo = new AggreJoinTotalThreadCountBo(id, timestamp, totalThreadCountJoinValue);
    return aggreJoinTotalThraedCountBo;
}
Also used : AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Example 2 with JoinTotalThreadCountBo

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

the class JoinTotalThreadCountBoMapperTest method map2Test.

@Test
public void map2Test() {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final JoinTotalThreadCountBoMapper mapper = new JoinTotalThreadCountBoMapper();
    final JoinTotalThreadCountBo joinTotalThreadCountBo = mapper.map(tFAgentStat);
    assertEquals(joinTotalThreadCountBo, joinTotalThreadCountBo.EMPTY_TOTAL_THREAD_COUNT_BO);
}
Also used : JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) Test(org.junit.Test)

Example 3 with JoinTotalThreadCountBo

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

the class JoinTotalThreadCountBoMapper method build.

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

Example 4 with JoinTotalThreadCountBo

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

the class TotalThreadCountCodec 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 totalThreadCountEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
    final List<JoinLongFieldBo> totalThreadCountList = this.codec.decodeValues(valueBuffer, totalThreadCountEncodingStrategy, numValues);
    List<JoinStatBo> joinTotalThreadCountBoList = new ArrayList<JoinStatBo>();
    for (int i = 0; i < numValues; i++) {
        JoinTotalThreadCountBo joinTotalThreadCountBo = new JoinTotalThreadCountBo();
        joinTotalThreadCountBo.setId(id);
        joinTotalThreadCountBo.setTimestamp(timestampList.get(i));
        joinTotalThreadCountBo.setTotalThreadCountJoinValue(totalThreadCountList.get(i));
        joinTotalThreadCountBoList.add(joinTotalThreadCountBo);
    }
    return joinTotalThreadCountBoList;
}
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) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) 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)

Example 5 with JoinTotalThreadCountBo

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

the class JoinAgentStatBoMapperTest method map6Test.

@Test
public void map6Test() {
    final String agentId = "testAgent";
    final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
    final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
    tFAgentStatBatch.setStartTimestamp(1491274138454L);
    tFAgentStatBatch.setAgentId(agentId);
    final TFTotalThreadCount tfTotalThreadCount = new TFTotalThreadCount();
    tfTotalThreadCount.setTotalThreadCount(100);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(agentId);
    tFAgentStat.setTimestamp(1491274148454L);
    tFAgentStat.setTotalThreadCount(tfTotalThreadCount);
    final TFTotalThreadCount tfTotalThreadCount2 = new TFTotalThreadCount();
    tfTotalThreadCount2.setTotalThreadCount(120);
    final TFAgentStat tFAgentStat2 = new TFAgentStat();
    tFAgentStat2.setAgentId(agentId);
    tFAgentStat2.setTimestamp(1491275148454L);
    tFAgentStat2.setTotalThreadCount(tfTotalThreadCount2);
    final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
    tFAgentStatList.add(tFAgentStat);
    tFAgentStatList.add(tFAgentStat2);
    tFAgentStatBatch.setAgentStats(tFAgentStatList);
    JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
    assertEquals(agentId, joinAgentStatBo.getId());
    assertEquals(1491274138454L, joinAgentStatBo.getAgentStartTimestamp());
    assertEquals(1491274148454L, joinAgentStatBo.getTimestamp());
    List<JoinTotalThreadCountBo> joinTotalThreadCountBoList = joinAgentStatBo.getJoinTotalThreadCountBoList();
    assertEquals(joinTotalThreadCountBoList.size(), 2);
    JoinTotalThreadCountBo joinTotalThreadCountBo = joinTotalThreadCountBoList.get(0);
    assertEquals(agentId, joinTotalThreadCountBo.getId());
    assertEquals(1491274148454L, joinTotalThreadCountBo.getTimestamp());
    assertEquals(new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId), joinTotalThreadCountBo.getTotalThreadCountJoinValue());
    JoinTotalThreadCountBo joinTotalThreadCountBo2 = joinTotalThreadCountBoList.get(1);
    assertEquals(agentId, joinTotalThreadCountBo2.getId());
    assertEquals(1491275148454L, joinTotalThreadCountBo2.getTimestamp());
    assertEquals(new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId), joinTotalThreadCountBo2.getTotalThreadCountJoinValue());
}
Also used : JoinAgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo) ArrayList(java.util.ArrayList) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFTotalThreadCount(com.navercorp.pinpoint.thrift.dto.flink.TFTotalThreadCount) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch) Test(org.junit.Test)

Aggregations

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