public SegmentReferenceRequest Transform() { SegmentReferenceRequest segmentReference = new SegmentReferenceRequest(); if (_type == SegmentRefType.CrossProcess) { segmentReference.RefType = (int)SegmentRefType.CrossProcess; segmentReference.NetworkAddress = new StringOrIntValue(_peerId, _peerHost); } else { segmentReference.RefType = (int)SegmentRefType.CrossThread; segmentReference.NetworkAddress = new StringOrIntValue(); } segmentReference.ParentServiceInstanceId = _parentApplicationInstanceId; segmentReference.EntryServiceInstanceId = _entryApplicationInstanceId; segmentReference.ParentSegmentId = _traceSegmentId.Transform(); segmentReference.ParentSpanId = _spanId; segmentReference.EntryEndpointName = new StringOrIntValue(_entryOperationId, _entryOperationName); segmentReference.ParentEndpointName = new StringOrIntValue(_parentOperationId, _parentOperationName); return(segmentReference); }
private static SegmentReference MapToSegmentReference(SegmentReferenceRequest referenceRequest) { var reference = new SegmentReference { TraceId = referenceRequest.TraceId, ParentService = referenceRequest.ParentServiceId, ParentServiceInstance = referenceRequest.ParentServiceInstanceId, ParentSpanId = referenceRequest.ParentSpanId, RefType = (RefType)referenceRequest.RefType, ParentTraceSegmentId = referenceRequest.ParentSegmentId, ParentEndpoint = referenceRequest.ParentEndpointName.ToString(), NetworkAddressUsedAtPeer = referenceRequest.NetworkAddress.ToString() }; return(reference); }
private static TraceSegmentReference MapToSegmentReference(SegmentReferenceRequest referenceRequest) { var reference = new TraceSegmentReference { ParentApplicationInstanceId = referenceRequest.ParentServiceInstanceId, EntryApplicationInstanceId = referenceRequest.EntryServiceInstanceId, ParentSpanId = referenceRequest.ParentSpanId, RefType = (RefType)referenceRequest.RefType, ParentTraceSegmentId = MapToUniqueId(referenceRequest.ParentSegmentId) }; ReadStringOrIntValue(reference, referenceRequest.NetworkAddress, NetworkAddressReader, NetworkAddressIdReader); ReadStringOrIntValue(reference, referenceRequest.EntryEndpointName, EntryServiceReader, EntryServiceIdReader); ReadStringOrIntValue(reference, referenceRequest.ParentEndpointName, ParentServiceReader, ParentServiceIdReader); return(reference); }