// Token: 0x060000A0 RID: 160 RVA: 0x00004E90 File Offset: 0x00003090 private bool OnBeforeExpire(Guid requestId, RequestMonitorContext context) { ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::OnBeforeExpire] Enter."); context[RequestMonitorMetadata.LoggingReason] = LoggingReason.Expired; ExTraceGlobals.InstrumentationTracer.TraceDebug <Guid>((long)this.GetHashCode(), "[RequestMonitor::OnBeforeExpire] Request {0} was committed.", requestId); this.Commit(context); ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::OnBeforeExpire] Exit."); return(true); }
// Token: 0x0600009C RID: 156 RVA: 0x00004C68 File Offset: 0x00002E68 internal void RegisterRequest(Guid requestId) { ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::RegisterRequest] Enter."); if (!RequestMonitor.Enabled.Value || this.IsThreadStopped) { ExTraceGlobals.InstrumentationTracer.TraceDebug <bool, bool>((long)this.GetHashCode(), "[RequestMonitor::RegisterRequest] Exit. RequestMonitorEnabled={0}, ThreadStopped={1}", RequestMonitor.Enabled.Value, this.IsThreadStopped); return; } RequestMonitorContext value = new RequestMonitorContext(requestId); this.requestContextCache.TryAddAbsolute(requestId, value, RequestMonitor.MaxRequestLifeTime.Value); ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::RegisterRequest] Exit."); }
// Token: 0x0600009F RID: 159 RVA: 0x00004E0C File Offset: 0x0000300C private void Commit(RequestMonitorContext context) { ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::Commit] Enter."); if (this.IsThreadStopped) { ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::Commit] Exit. Worker thread stopped."); return; } context[RequestMonitorMetadata.EndTime] = DateTime.UtcNow; this.logItemQueue.Enqueue(context); this.workerSignal.Set(); ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::Commit] Exit."); }
internal void Commit(RequestMonitorContext context) { if (context == null) { return; } LogRowFormatter logRowFormatter = new LogRowFormatter(this.logSchema); for (int i = 0; i < context.Fields.Length; i++) { logRowFormatter[i] = context[i]; } this.log.Append(logRowFormatter, -1); }
// Token: 0x060000A2 RID: 162 RVA: 0x00004F28 File Offset: 0x00003128 private void WorkerProc(object state) { for (;;) { try { while (this.logItemQueue.Count > 0) { RequestMonitorContext context = this.logItemQueue.Dequeue() as RequestMonitorContext; this.Logger.Commit(context); } } catch (Exception exception) { Diagnostics.ReportException(exception, LoggerSettings.EventLog, LoggerSettings.EventTuple, null, null, ExTraceGlobals.InstrumentationTracer, "Exception from RequestMonitor : {0}"); } this.workerSignal.WaitOne(); } }
// Token: 0x0600009D RID: 157 RVA: 0x00004CFC File Offset: 0x00002EFC internal void UnRegisterRequest(Guid requestId) { ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::UnRegisterRequest] Enter."); if (!RequestMonitor.Enabled.Value) { return; } if (this.requestContextCache.Contains(requestId)) { this.requestContextCache.Remove(requestId); } else { RequestMonitorContext requestMonitorContext = RequestMonitorContext.Current; if (requestMonitorContext != null) { requestMonitorContext[RequestMonitorMetadata.LoggingReason] = LoggingReason.End; this.Commit(RequestMonitorContext.Current); } } ExTraceGlobals.InstrumentationTracer.TraceFunction((long)this.GetHashCode(), "[RequestMonitor::UnRegisterRequest] Exit."); }
// Token: 0x0600009A RID: 154 RVA: 0x00004BC4 File Offset: 0x00002DC4 internal bool TryGetCurrentRequestMonitorContext(Guid requestId, out RequestMonitorContext context) { context = RequestMonitorContext.Current; return(context != null || this.requestContextCache.TryGetValue(requestId, out context)); }