Source:
public CommunicationDetails processOneToOne(String tenantId, Span item) throws RetryAttemptException { CommunicationDetails ret = null; if (log.isLoggable(Level.FINEST)) { log.finest("Derive communication details for span: " + item); } if (item.serverSpan()) { ProducerInfo pi = producerInfoCache.get(tenantId, item.getId()); if (pi != null) { ret = new CommunicationDetails(); ret.setId(item.getId()); ret.setSource(EndpointUtil.encodeEndpoint(pi.getSourceUri(), pi.getSourceOperation())); URL url = item.url(); String op = item.operation(); if (url != null) { ret.setTarget(EndpointUtil.encodeEndpoint(url.getPath(), op)); } else { log.warning("NO URL"); } long diff = TimeUnit.MILLISECONDS.convert(pi.getDuration() - (item.getDuration()/1000), TimeUnit.NANOSECONDS); if (diff > 0) { ret.setLatency(diff / 2); } else if (diff < 0) { if (log.isLoggable(Level.FINEST)) { log.finest("WARNING: Negative latency for consumer = " + item); } } ret.setProducerDuration(pi.getDuration()); ret.setConsumerDuration(item.getDuration()/1000); ret.setMultiConsumer(pi.isMultipleConsumers()); List<Property> spanProperties = item.properties(); ret.getProperties().addAll(spanProperties); ret.getProperties().addAll(pi.getProperties()); ret.setSourceFragmentId(pi.getFragmentId()); ret.setSourceHostAddress(pi.getHostAddress()); ret.setTargetFragmentId(item.getId()); ret.setTargetHostAddress(Span.ipv4Address(spanProperties)); ret.setTimestamp(pi.getTimestamp()); long timestampOffset = item.getTimestamp() - pi.getTimestamp() - ret.getLatency(); ret.setTimestampOffset(timestampOffset); } else { if (log.isLoggable(Level.FINEST)) { log.finest("WARNING: Producer information not available [id checked = " + item.getId() + "]"); } throw new RetryAttemptException("Producer information not available [id checked = " + item.getId() + "]"); } } if (log.isLoggable(Level.FINEST)) { log.finest("Derived communication details: " + ret); } return ret; }

Target:
public CommunicationDetails processOneToOne(String tenantId, Span item) throws RetryAttemptException { CommunicationDetails ret = null; if (log.isLoggable(Level.FINEST)) { log.finest("Derive communication details for span: " + item); } if (item.serverSpan()) { ProducerInfo pi = producerInfoCache.get(tenantId, item.getId()); if (pi != null) { ret = new CommunicationDetails(); ret.setId(item.getId()); ret.setSource(EndpointUtil.encodeEndpoint(pi.getSourceUri(), pi.getSourceOperation())); URL url = item.url(); String op = item.operation(); if (url != null) { ret.setTarget(EndpointUtil.encodeEndpoint(url.getPath(), op)); } else { log.warning("NO URL"); } long diff = TimeUnit.MILLISECONDS.convert(pi.getDuration() - (item.getDuration()/1000), TimeUnit.NANOSECONDS); if (diff > 0) { ret.setLatency(diff / 2); } else if (diff < 0) { if (log.isLoggable(Level.FINEST)) { log.finest("WARNING: Negative latency for consumer = " + item); } } ret.setProducerDuration(pi.getDuration()); ret.setConsumerDuration(item.getDuration()/1000); ret.setMultiConsumer(pi.isMultipleConsumers()); List<Property> spanProperties = item.properties(); ret.getProperties().addAll(spanProperties); ret.getProperties().addAll(pi.getProperties()); ret.setSourceFragmentId(pi.getFragmentId()); ret.setSourceHostName(pi.getHostName()); ret.setSourceHostAddress(pi.getHostAddress()); ret.setTargetFragmentId(item.getId()); ret.setTargetHostAddress(Span.ipv4Address(spanProperties)); ret.setTimestamp(pi.getTimestamp()); long timestampOffset = item.getTimestamp() - pi.getTimestamp() - ret.getLatency(); ret.setTimestampOffset(timestampOffset); } else { if (log.isLoggable(Level.FINEST)) { log.finest("WARNING: Producer information not available [id checked = " + item.getId() + "]"); } throw new RetryAttemptException("Producer information not available [id checked = " + item.getId() + "]"); } } if (log.isLoggable(Level.FINEST)) { log.finest("Derived communication details: " + ret); } return ret; }