Search in sources :

Example 1 with StringStringValue

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

the class MongoUtil method recordParsedBson.

public static void recordParsedBson(SpanEventRecorder recorder, NormalizedBson normalizedBson) {
    if (normalizedBson != null) {
        StringStringValue stringStringValue = new StringStringValue(normalizedBson.getNormalizedBson(), normalizedBson.getParameter());
        recorder.recordAttribute(MongoConstants.MONGO_JSON_DATA, stringStringValue);
    }
}
Also used : StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue)

Example 2 with StringStringValue

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

the class DataTypeAnnotation method apply.

@Override
public PAnnotationValue apply(GrpcAnnotationValueMapper context) {
    PAnnotationValue.Builder builder = context.getAnnotationBuilder();
    final DataType dataType = this.value;
    if (dataType instanceof IntStringValue) {
        final IntStringValue v = (IntStringValue) dataType;
        PIntStringValue pIntStringValue = context.newIntStringValue(v);
        builder.setIntStringValue(pIntStringValue);
        return builder.build();
    } else if (dataType instanceof StringStringValue) {
        final StringStringValue v = (StringStringValue) dataType;
        PStringStringValue pStringStringValue = context.newStringStringValue(v);
        builder.setStringStringValue(pStringStringValue);
        return builder.build();
    } else if (dataType instanceof IntStringStringValue) {
        final IntStringStringValue v = (IntStringStringValue) dataType;
        final PIntStringStringValue pIntStringStringValue = context.newIntStringStringValue(v);
        builder.setIntStringStringValue(pIntStringStringValue);
        return builder.build();
    } else if (dataType instanceof LongIntIntByteByteStringValue) {
        final LongIntIntByteByteStringValue v = (LongIntIntByteByteStringValue) dataType;
        final PLongIntIntByteByteStringValue pValue = context.newLongIntIntByteByteStringValue(v);
        builder.setLongIntIntByteByteStringValue(pValue);
        return builder.build();
    } else if (dataType instanceof IntBooleanIntBooleanValue) {
        final IntBooleanIntBooleanValue v = (IntBooleanIntBooleanValue) dataType;
        final PIntBooleanIntBooleanValue pValue = context.newIntBooleanIntBooleanValue(v);
        builder.setIntBooleanIntBooleanValue(pValue);
        return builder.build();
    }
    throw new UnsupportedOperationException("unsupported type:" + dataType);
}
Also used : PAnnotationValue(com.navercorp.pinpoint.grpc.trace.PAnnotationValue) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) 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) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) DataType(com.navercorp.pinpoint.common.util.DataType)

Example 3 with StringStringValue

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

the class MongoDBITBase method updateData.

public void updateData(PluginTestVerifier verifier, MongoCollection<Document> collection, Class<?> mongoDatabaseImpl) {
    // update Data
    Document doc = new Document("name", "Roy").append("company", "Naver");
    Document doc2 = new Document("$set", new Document("name", "Roy3"));
    collection.updateOne(doc, doc2);
    Method updateOne = getMethod(mongoDatabaseImpl, "updateOne", Bson.class, Bson.class);
    NormalizedBson parsedBson = parseBson(doc, doc2);
    verifier.verifyTrace(event(MONGO_EXECUTE_QUERY, updateOne, null, MongoDBITConstants.MONGODB_ADDRESS, null, new ExpectedAnnotation(MongoConstants.MONGO_COLLECTION_INFO.getName(), "customers"), new ExpectedAnnotation(MongoConstants.MONGO_COLLECTION_OPTION.getName(), "MAJORITY"), new ExpectedAnnotation(MongoConstants.MONGO_JSON_DATA.getName(), new StringStringValue(parsedBson.getNormalizedBson(), parsedBson.getParameter()))));
}
Also used : ExpectedAnnotation(com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedAnnotation) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) NormalizedBson(com.navercorp.pinpoint.plugin.mongo.NormalizedBson) Method(java.lang.reflect.Method) Document(org.bson.Document) BsonDocument(org.bson.BsonDocument)

Example 4 with StringStringValue

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

the class MongoDBITBase method filterData.

public void filterData(PluginTestVerifier verifier, MongoCollection<Document> collection, Class<?> mongoDatabaseImpl) {
    Method find = getMethod(mongoDatabaseImpl, "find", Bson.class);
    Bson bson = eq("name", "Roy3");
    NormalizedBson parsedBson = parseBson(bson);
    MongoCursor<Document> cursor = collection.find(bson).iterator();
    verifier.verifyTrace(event(MONGO_EXECUTE_QUERY, find, null, MongoDBITConstants.MONGODB_ADDRESS, null, new ExpectedAnnotation(MongoConstants.MONGO_COLLECTION_INFO.getName(), "customers"), new ExpectedAnnotation(MongoConstants.MONGO_COLLECTION_OPTION.getName(), "secondaryPreferred"), new ExpectedAnnotation(MongoConstants.MONGO_JSON_DATA.getName(), new StringStringValue(parsedBson.getNormalizedBson(), parsedBson.getParameter()))));
    assertResultSize(1, cursor);
}
Also used : ExpectedAnnotation(com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedAnnotation) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) NormalizedBson(com.navercorp.pinpoint.plugin.mongo.NormalizedBson) Method(java.lang.reflect.Method) Document(org.bson.Document) BsonDocument(org.bson.BsonDocument) Bson(org.bson.conversions.Bson) NormalizedBson(com.navercorp.pinpoint.plugin.mongo.NormalizedBson)

Example 5 with StringStringValue

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

the class AllServerResponseHeaderRecorder method recordHeader.

@Override
public void recordHeader(final AttributeRecorder recorder, final RESP response) {
    for (String headerName : getHeaderNames(response)) {
        if (StringUtils.isEmpty(headerName)) {
            continue;
        }
        final Collection<String> headers = responseAdaptor.getHeaderNames(response);
        if (CollectionUtils.isEmpty(headers)) {
            continue;
        }
        StringStringValue header = new StringStringValue(headerName, formatHeaderValues(headers));
        recorder.recordAttribute(AnnotationKey.HTTP_RESPONSE_HEADER, header);
    }
}
Also used : StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue)

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