Search in sources :

Example 6 with StringStringValue

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

the class DefaultServerResponseHeaderRecorder method recordHeader.

@Override
public void recordHeader(final AttributeRecorder recorder, final RESP response) {
    for (String headerName : recordHeaders) {
        if (StringUtils.isEmpty(headerName)) {
            continue;
        }
        final Collection<String> headers = responseAdaptor.getHeaders(response, headerName);
        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)

Example 7 with StringStringValue

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

the class AllServerHeaderRecorder method recordHeader.

@Override
public void recordHeader(final SpanRecorder recorder, final REQ request) {
    final Collection<String> headerNames = getHeaderNames(request);
    for (String headerName : headerNames) {
        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 8 with StringStringValue

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

the class DefaultServerCookieRecorder method recordCookie.

@Override
public void recordCookie(final SpanRecorder recorder, final REQ request) {
    List<CookieAdaptor> cookieList = requestAdaptor.getCookie(request, recordCookies);
    if (CollectionUtils.isEmpty(cookieList)) {
        return;
    }
    for (CookieAdaptor cookieAdaptor : cookieList) {
        StringStringValue cookie = new StringStringValue(cookieAdaptor.getName(), cookieAdaptor.getValue());
        recorder.recordAttribute(AnnotationKey.HTTP_COOKIE, cookie);
    }
}
Also used : StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue)

Example 9 with StringStringValue

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

the class AnnotationTranscoder method decodeStringStringValue.

// private Object decodeIntStringStringValue(byte[] data) {
// final Buffer buffer = new FixedBuffer(data);
// final int intValue = buffer.readSVInt();
// final String stringValue1 = BytesUtils.toString(buffer.readPrefixedBytes());
// final String stringValue2 = BytesUtils.toString(buffer.readPrefixedBytes());
// return new IntStringStringValue(intValue, stringValue1, stringValue2);
// }
// 
// private byte[] encodeIntStringStringValue(Object o) {
// final TIntStringStringValue tIntStringStringValue = (TIntStringStringValue) o;
// final int intValue = tIntStringStringValue.getIntValue();
// final byte[] stringValue1 = BytesUtils.toBytes(tIntStringStringValue.getStringValue1());
// final byte[] stringValue2 = BytesUtils.toBytes(tIntStringStringValue.getStringValue2());
// // TODO increase by a more precise value
// final int bufferSize = getBufferSize(stringValue1, stringValue2, 4 + 8);
// final Buffer buffer = new AutomaticBuffer(bufferSize);
// buffer.putSVInt(intValue);
// buffer.putPrefixedBytes(stringValue1);
// buffer.putPrefixedBytes(stringValue2);
// return buffer.getBuffer();
// }
// 
// private int getBufferSize(byte[] stringValue1, byte[] stringValue2, int reserve) {
// int length = 0;
// if (stringValue1 != null) {
// length += stringValue1.length;
// }
// if (stringValue2 != null) {
// length += stringValue2.length;
// 
// }
// return length + reserve;
// }
// 
private Object decodeStringStringValue(byte[] data) {
    final Buffer buffer = new FixedBuffer(data);
    final String stringValue1 = BytesUtils.toString(buffer.readPrefixedBytes());
    final String stringValue2 = BytesUtils.toString(buffer.readPrefixedBytes());
    return new StringStringValue(stringValue1, stringValue2);
}
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) FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer)

Example 10 with StringStringValue

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

the class GrpcAnnotationValueMapper method newStringStringValue.

public PStringStringValue newStringStringValue(StringStringValue v) {
    final PStringStringValue.Builder builder = this.stringStringBuilder;
    if (v.getStringValue1() != null) {
        StringValue stringValue1 = newStringValue(v.getStringValue1());
        builder.setStringValue1(stringValue1);
    }
    if (v.getStringValue2() != null) {
        StringValue stringValue2 = newStringValue(v.getStringValue2());
        builder.setStringValue2(stringValue2);
    }
    PStringStringValue value = builder.build();
    builder.clear();
    return value;
}
Also used : IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) StringValue(com.google.protobuf.StringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue)

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