Search in sources :

Example 11 with StringStringValue

use of com.navercorp.pinpoint.common.util.StringStringValue in project pinpoint by naver.

the class DataTypeAnnotation method apply.

@Override
public TAnnotationValue apply(AnnotationValueThriftMapper context) {
    final DataType dataType = this.value;
    if (dataType instanceof IntStringValue) {
        final IntStringValue v = (IntStringValue) dataType;
        final TIntStringValue tIntStringValue = new TIntStringValue(v.getIntValue());
        if (v.getStringValue() != null) {
            tIntStringValue.setStringValue(v.getStringValue());
        }
        return TAnnotationValue.intStringValue(tIntStringValue);
    } else if (dataType instanceof StringStringValue) {
        final StringStringValue v = (StringStringValue) dataType;
        final TStringStringValue tStringStringValue = new TStringStringValue(v.getStringValue1());
        if (v.getStringValue2() != null) {
            tStringStringValue.setStringValue2(v.getStringValue2());
        }
        return TAnnotationValue.stringStringValue(tStringStringValue);
    } else if (dataType instanceof IntStringStringValue) {
        final IntStringStringValue v = (IntStringStringValue) dataType;
        final TIntStringStringValue tIntStringStringValue = new TIntStringStringValue(v.getIntValue());
        if (v.getStringValue1() != null) {
            tIntStringStringValue.setStringValue1(v.getStringValue1());
        }
        if (v.getStringValue2() != null) {
            tIntStringStringValue.setStringValue2(v.getStringValue2());
        }
        return TAnnotationValue.intStringStringValue(tIntStringStringValue);
    } else if (dataType instanceof LongIntIntByteByteStringValue) {
        final LongIntIntByteByteStringValue v = (LongIntIntByteByteStringValue) dataType;
        final TLongIntIntByteByteStringValue tvalue = new TLongIntIntByteByteStringValue(v.getLongValue(), v.getIntValue1());
        if (v.getIntValue2() != -1) {
            tvalue.setIntValue2(v.getIntValue2());
        }
        if (v.getByteValue1() != -1) {
            tvalue.setByteValue1(v.getByteValue1());
        }
        if (v.getByteValue2() != -1) {
            tvalue.setByteValue2(v.getByteValue2());
        }
        if (v.getStringValue() != null) {
            tvalue.setStringValue(v.getStringValue());
        }
        return TAnnotationValue.longIntIntByteByteStringValue(tvalue);
    } else if (dataType instanceof IntBooleanIntBooleanValue) {
        final IntBooleanIntBooleanValue v = (IntBooleanIntBooleanValue) dataType;
        final TIntBooleanIntBooleanValue tvalue = new TIntBooleanIntBooleanValue(v.getIntValue1(), v.isBooleanValue1(), v.getIntValue2(), v.isBooleanValue2());
        return TAnnotationValue.intBooleanIntBooleanValue(tvalue);
    }
    throw new UnsupportedOperationException("unsupported type:" + dataType);
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) TStringStringValue(com.navercorp.pinpoint.thrift.dto.TStringStringValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TStringStringValue(com.navercorp.pinpoint.thrift.dto.TStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) DataType(com.navercorp.pinpoint.common.util.DataType) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)

Example 12 with StringStringValue

use of com.navercorp.pinpoint.common.util.StringStringValue in project pinpoint by naver.

the class DefaultServerHeaderRecorder method recordHeader.

@Override
public void recordHeader(final SpanRecorder recorder, final REQ request) {
    for (String headerName : recordHeaders) {
        final String value = requestAdaptor.getHeader(request, headerName);
        if (value == null) {
            continue;
        }
        StringStringValue header = new StringStringValue(headerName, value);
        recorder.recordAttribute(AnnotationKey.HTTP_REQUEST_HEADER, header);
    }
}
Also used : StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue)

Example 13 with StringStringValue

use of com.navercorp.pinpoint.common.util.StringStringValue in project pinpoint by naver.

the class AnnotationTranscoder method encodeStringStringValue.

private byte[] encodeStringStringValue(Object o) {
    final StringStringValue tStringStringValue = (StringStringValue) o;
    final byte[] stringValue1 = BytesUtils.toBytes(tStringStringValue.getStringValue1());
    final byte[] stringValue2 = BytesUtils.toBytes(tStringStringValue.getStringValue2());
    // TODO increase by a more precise value
    final int bufferSize = getBufferSize(stringValue1, stringValue2);
    final Buffer buffer = new AutomaticBuffer(bufferSize);
    buffer.putPrefixedBytes(stringValue1);
    buffer.putPrefixedBytes(stringValue2);
    return buffer.getBuffer();
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer)

Example 14 with StringStringValue

use of com.navercorp.pinpoint.common.util.StringStringValue in project pinpoint by naver.

the class GrpcAnnotationHandler method newStringStringValue.

private StringStringValue newStringStringValue(Object annotationValue) {
    final PStringStringValue pValue = (PStringStringValue) annotationValue;
    String stringValue1 = null;
    if (pValue.hasStringValue1()) {
        stringValue1 = pValue.getStringValue1().getValue();
    }
    String stringValue2 = null;
    if (pValue.hasStringValue2()) {
        stringValue2 = pValue.getStringValue2().getValue();
    }
    return new StringStringValue(stringValue1, stringValue2);
}
Also used : PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue)

Example 15 with StringStringValue

use of com.navercorp.pinpoint.common.util.StringStringValue in project pinpoint by naver.

the class MongoDBITBase method insertComlexBsonValueData34.

public void insertComlexBsonValueData34(PluginTestVerifier verifier, MongoCollection<Document> collection, Class<?> mongoDatabaseImpl, String collectionInfo, String collectionOption) {
    // insert Data
    Document document = createComplexDocument();
    document.append("decimal128", new BsonDecimal128(new Decimal128(55)));
    collection.insertOne(document);
    Method insertOneMethod = getMethod(mongoDatabaseImpl, "insertOne", Object.class);
    NormalizedBson parsedBson = parseBson(document);
    verifier.verifyTrace(event(MONGO_EXECUTE_QUERY, insertOneMethod, null, MongoDBITConstants.MONGODB_ADDRESS, null, new ExpectedAnnotation(MongoConstants.MONGO_COLLECTION_INFO.getName(), collectionInfo), new ExpectedAnnotation(MongoConstants.MONGO_COLLECTION_OPTION.getName(), collectionOption), new ExpectedAnnotation(MongoConstants.MONGO_JSON_DATA.getName(), new StringStringValue(parsedBson.getNormalizedBson(), parsedBson.getParameter()))));
}
Also used : ExpectedAnnotation(com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedAnnotation) BsonDecimal128(org.bson.BsonDecimal128) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) NormalizedBson(com.navercorp.pinpoint.plugin.mongo.NormalizedBson) BsonDecimal128(org.bson.BsonDecimal128) Decimal128(org.bson.types.Decimal128) Method(java.lang.reflect.Method) Document(org.bson.Document) BsonDocument(org.bson.BsonDocument)

Aggregations

StringStringValue (com.navercorp.pinpoint.common.util.StringStringValue)20 ExpectedAnnotation (com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedAnnotation)7 IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)7 NormalizedBson (com.navercorp.pinpoint.plugin.mongo.NormalizedBson)7 Method (java.lang.reflect.Method)7 BsonDocument (org.bson.BsonDocument)7 Document (org.bson.Document)7 PIntStringStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringStringValue)5 PStringStringValue (com.navercorp.pinpoint.grpc.trace.PStringStringValue)5 IntStringValue (com.navercorp.pinpoint.common.util.IntStringValue)3 LongIntIntByteByteStringValue (com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)3 PIntStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringValue)3 PLongIntIntByteByteStringValue (com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue)3 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)2 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)2 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)2 DataType (com.navercorp.pinpoint.common.util.DataType)2 IntBooleanIntBooleanValue (com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue)2 PAnnotationValue (com.navercorp.pinpoint.grpc.trace.PAnnotationValue)2 PIntBooleanIntBooleanValue (com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue)2