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