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);
}
}
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);
}
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()))));
}
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);
}
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);
}
}
Aggregations