Search in sources :

Example 16 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class TraceIndexScatterMapper method createDot.

private Dot createDot(Cell cell) {
    final Buffer valueBuffer = new OffsetFixedBuffer(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
    int elapsed = valueBuffer.readVInt();
    int exceptionCode = valueBuffer.readSVInt();
    String agentId = valueBuffer.readPrefixedString();
    long reverseAcceptedTime = BytesUtils.bytesToLong(cell.getRowArray(), cell.getRowOffset() + HBaseTables.APPLICATION_NAME_MAX_LEN + HBaseTables.APPLICATION_TRACE_INDEX_ROW_DISTRIBUTE_SIZE);
    long acceptedTime = TimeUtils.recoveryTimeMillis(reverseAcceptedTime);
    final int qualifierOffset = cell.getQualifierOffset();
    TransactionId transactionId = TransactionIdMapper.parseVarTransactionId(cell.getQualifierArray(), qualifierOffset, cell.getQualifierLength());
    return new Dot(transactionId, acceptedTime, elapsed, exceptionCode, agentId);
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 17 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class TraceIndexScatterMapper2 method createDot.

private Dot createDot(Cell cell) {
    final Buffer valueBuffer = new OffsetFixedBuffer(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
    int elapsed = valueBuffer.readVInt();
    if (elapsed < responseOffsetFrom || elapsed > responseOffsetTo) {
        return null;
    }
    int exceptionCode = valueBuffer.readSVInt();
    String agentId = valueBuffer.readPrefixedString();
    long reverseAcceptedTime = BytesUtils.bytesToLong(cell.getRowArray(), cell.getRowOffset() + HBaseTables.APPLICATION_NAME_MAX_LEN + HBaseTables.APPLICATION_TRACE_INDEX_ROW_DISTRIBUTE_SIZE);
    long acceptedTime = TimeUtils.recoveryTimeMillis(reverseAcceptedTime);
    final int qualifierOffset = cell.getQualifierOffset();
    // TransactionId transactionId = new TransactionId(buffer,
    // qualifierOffset);
    // for temporary, used TransactionIdMapper
    TransactionId transactionId = TransactionIdMapper.parseVarTransactionId(cell.getQualifierArray(), qualifierOffset, cell.getQualifierLength());
    return new Dot(transactionId, acceptedTime, elapsed, exceptionCode, agentId);
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 18 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class TraceIndexScatterMapper3 method mapRow.

@Override
public ScatterData mapRow(Result result, int rowNum) throws Exception {
    if (result.isEmpty()) {
        return new ScatterData(from, to, xGroupUnit, yGroupUnit);
    }
    ScatterData scatterData = new ScatterData(from, to, xGroupUnit, yGroupUnit);
    Cell[] rawCells = result.rawCells();
    for (Cell cell : rawCells) {
        final Dot dot = createDot(cell);
        if (dot != null) {
            scatterData.addDot(dot);
        }
    }
    return scatterData;
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) Cell(org.apache.hadoop.hbase.Cell) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData)

Example 19 with Dot

use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.

the class TraceIndexScatterMapper3 method createDot.

private Dot createDot(Cell cell) {
    final Buffer valueBuffer = new OffsetFixedBuffer(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
    int elapsed = valueBuffer.readVInt();
    int exceptionCode = valueBuffer.readSVInt();
    String agentId = valueBuffer.readPrefixedString();
    long reverseAcceptedTime = BytesUtils.bytesToLong(cell.getRowArray(), cell.getRowOffset() + HBaseTables.APPLICATION_NAME_MAX_LEN + HBaseTables.APPLICATION_TRACE_INDEX_ROW_DISTRIBUTE_SIZE);
    long acceptedTime = TimeUtils.recoveryTimeMillis(reverseAcceptedTime);
    // TransactionId transactionId = new TransactionId(buffer,
    // qualifierOffset);
    // for temporary, used TransactionIdMapper
    TransactionId transactionId = TransactionIdMapper.parseVarTransactionId(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
    return new Dot(transactionId, acceptedTime, elapsed, exceptionCode, agentId);
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Aggregations

Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)19 TransactionId (com.navercorp.pinpoint.common.util.TransactionId)9 ArrayList (java.util.ArrayList)8 List (java.util.List)5 Test (org.junit.Test)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)3 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)3 ScatterData (com.navercorp.pinpoint.web.scatter.ScatterData)3 Cell (org.apache.hadoop.hbase.Cell)3 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 TraceIndexScatterMapper2 (com.navercorp.pinpoint.web.mapper.TraceIndexScatterMapper2)1 DotGroup (com.navercorp.pinpoint.web.scatter.DotGroup)1 ResponseTimeRange (com.navercorp.pinpoint.web.vo.ResponseTimeRange)1 ApplicationScatterScanResult (com.navercorp.pinpoint.web.vo.scatter.ApplicationScatterScanResult)1 ScatterScanResult (com.navercorp.pinpoint.web.vo.scatter.ScatterScanResult)1 Random (java.util.Random)1 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)1 Scan (org.apache.hadoop.hbase.client.Scan)1