Exemple #1
0
 public async Task <ClientSpan> StartSpan(StartSpanArgs args)
 {
     using (await _asyncLock.LockAsync())
     {
         var clientSpan = ClientSpan.Create(args.TraceId, args.ParentSpanId, Guid.NewGuid().ToString());
         ClientSpans.Add(clientSpan.SpanId, clientSpan);
         return(await Task.FromResult(clientSpan));
     }
 }
Exemple #2
0
 public async Task <ClientSpan> GetSpan(IClientSpanLocate args)
 {
     using (await _asyncLock.LockAsync())
     {
         ClientSpan clientSpan = null;
         if (ClientSpans.ContainsKey(args.SpanId))
         {
             clientSpan = ClientSpans[args.SpanId];
         }
         return(await Task.FromResult(clientSpan));
     }
 }