Source:
static HttpRequestEvent createHttpRequestEvent(RequestInfo requestInfo, ResponseInfo responseInfo) { requireNonNull(requestInfo, "requestInfo is null"); requireNonNull(responseInfo, "responseInfo is null"); Request request = requestInfo.getRequest(); Optional<Response> response = responseInfo.getResponse(); String requestUri = null; if (request.getURI() != null) { requestUri = request.getURI().toString(); } String method = request.getMethod(); if (method != null) { method = method.toUpperCase(Locale.US); } long responseSize = NO_RESPONSE; int responseCode = NO_RESPONSE; if (response.isPresent()) { responseSize = responseInfo.getResponseSize(); responseCode = response.get().getStatus(); } long requestTotalTime = requestInfo.getRequestQueueTime() + (responseInfo.getResponseCompleteTimestamp() - requestInfo.getRequestBeginTimestamp()); long requestBeginToRequestEnd = requestInfo.getRequestEndTimestamp() - requestInfo.getRequestBeginTimestamp(); long responseBeginTimeStamp = responseInfo.getResponseBeginTimestamp(); long requestEndToResponseBegin = 0; long responseBeginToResponseEnd = 0; if (responseBeginTimeStamp != 0) { requestEndToResponseBegin = responseBeginTimeStamp - requestInfo.getRequestEndTimestamp(); responseBeginToResponseEnd = responseInfo.getResponseCompleteTimestamp() - responseBeginTimeStamp; } long timeToLastByte = max(responseInfo.getResponseTimestampMillis() - requestInfo.getRequestTimestampMillis(), 0L); return new HttpRequestEvent( Instant.ofEpochMilli(requestInfo.getRequestTimestampMillis()), request.getVersion().toString(), method, requestUri, getHeader(request, TRACETOKEN_HEADER), responseSize, responseCode, requestTotalTime, requestInfo.getRequestQueueTime(), requestBeginToRequestEnd, requestEndToResponseBegin, responseBeginToResponseEnd, timeToLastByte, getFailureReason(responseInfo)); }

Target:
static HttpRequestEvent createHttpRequestEvent(RequestInfo requestInfo, ResponseInfo responseInfo) { requireNonNull(requestInfo, "requestInfo is null"); requireNonNull(responseInfo, "responseInfo is null"); Request request = requestInfo.getRequest(); Optional<Response> response = responseInfo.getResponse(); String requestUri = null; if (request.getURI() != null) { requestUri = request.getURI().toString(); } String method = request.getMethod(); if (method != null) { method = method.toUpperCase(Locale.US); } long responseSize = NO_RESPONSE; int responseCode = NO_RESPONSE; if (response.isPresent()) { responseSize = responseInfo.getResponseSize(); responseCode = response.get().getStatus(); } long requestTotalTimeNanos = responseInfo.getResponseCompleteTimestamp() - requestInfo.getRequestCreatedTimestamp(); long requestBeginToRequestEndNanos = requestInfo.getRequestEndTimestamp() - requestInfo.getRequestBeginTimestamp(); long responseBeginTimeStamp = responseInfo.getResponseBeginTimestamp(); long requestEndToResponseBeginNanos = 0; long responseBeginToResponseEndNanos = 0; if (responseBeginTimeStamp != 0) { requestEndToResponseBeginNanos = responseBeginTimeStamp - requestInfo.getRequestEndTimestamp(); responseBeginToResponseEndNanos = responseInfo.getResponseCompleteTimestamp() - responseBeginTimeStamp; } long timeToLastByte = max(responseInfo.getResponseTimestampMillis() - requestInfo.getRequestTimestampMillis(), 0L); return new HttpRequestEvent( Instant.ofEpochMilli(requestInfo.getRequestTimestampMillis()), request.getVersion().toString(), method, requestUri, getHeader(request, TRACETOKEN_HEADER), responseSize, responseCode, NANOSECONDS.toMillis(requestTotalTimeNanos), NANOSECONDS.toMillis(requestInfo.getRequestBeginTimestamp() - requestInfo.getRequestCreatedTimestamp()), NANOSECONDS.toMillis(requestBeginToRequestEndNanos), NANOSECONDS.toMillis(requestEndToResponseBeginNanos), NANOSECONDS.toMillis(responseBeginToResponseEndNanos), timeToLastByte, getFailureReason(responseInfo)); }