public void AnnotationsAreCorrectlyRecorded() { var memoryTracer = new InMemoryTracer(); var spanState = new SpanState(1, 0, 1, isSampled: null, isDebug: false); var rpcAnn = Annotations.Rpc("GET RPC"); var recordRpc = new Record(spanState, TimeUtils.UtcNow, rpcAnn); var servAnn = Annotations.ServiceName("MyCriteoService"); var recordServName = new Record(spanState, TimeUtils.UtcNow, servAnn); var servRecv = Annotations.ServerRecv(); var recordServR = new Record(spanState, TimeUtils.UtcNow, servRecv); var servSend = Annotations.ServerSend(); var recordServS = new Record(spanState, TimeUtils.UtcNow, servSend); memoryTracer.Record(recordRpc); memoryTracer.Record(recordServName); memoryTracer.Record(recordServR); memoryTracer.Record(recordServS); var records = memoryTracer.Records.ToList(); var annotations = records.Select(record => record.Annotation).ToList(); Assert.AreEqual(4, annotations.Count()); Assert.True(annotations.Contains(rpcAnn)); Assert.True(annotations.Contains(servAnn)); Assert.True(annotations.Contains(servRecv)); Assert.True(annotations.Contains(servSend)); }
public void Setup() { _logger = Substitute.For <ILogger>(); _tracer = new InMemoryTracer(); TraceManager.SamplingRate = 1.0f; TraceManager.RegisterTracer(_tracer); TraceManager.Start(_logger); }
public void Setup() { logger = Substitute.For <ILogger>(); tracer = new InMemoryTracer(); traceExtractor = Substitute.For <ITraceExtractor>(); TraceManager.SamplingRate = 1.0f; TraceManager.RegisterTracer(tracer); TraceManager.Start(logger); }
// Token: 0x06001AA4 RID: 6820 RVA: 0x00064110 File Offset: 0x00062310 private void InitializeTracers() { ITracer tracer; if (!base.IsRequestTracingEnabled) { ITracer instance = NullTracer.Instance; tracer = instance; } else { tracer = new InMemoryTracer(ExTraceGlobals.GetPersonaPhotoTracer.Category, ExTraceGlobals.GetPersonaPhotoTracer.TraceTag); } this.requestTracer = tracer; this.tracer = ExTraceGlobals.GetPersonaPhotoTracer.Compose(this.requestTracer); }
// Token: 0x06001BCC RID: 7116 RVA: 0x0006B230 File Offset: 0x00069430 public SetUserTheme(CallContext callContext, SetUserThemeRequest request) : base(callContext) { WcfServiceCommandBase.ThrowIfNull(request, "SetUserThemeRequest", "SetUserTheme::SetUserTheme"); this.request = request; ITracer tracer; if (!base.IsRequestTracingEnabled) { ITracer instance = NullTracer.Instance; tracer = instance; } else { tracer = new InMemoryTracer(ExTraceGlobals.ThemesCallTracer.Category, ExTraceGlobals.ThemesCallTracer.TraceTag); } this.requestTracer = tracer; this.tracer = ExTraceGlobals.ThemesCallTracer.Compose(this.requestTracer); }