/// <summary> /// Logs the scope end /// </summary> /// <param name="scope">Scope to log</param> /// <param name="data">Correlation data</param> public void LogScopeEnd(TimedScope scope, CorrelationData data) { if (!Code.ValidateArgument(scope, nameof(scope), TaggingUtilities.ReserveTag(0x2375d3d8 /* tag_933py */)) || !Code.ValidateArgument(data, nameof(data), TaggingUtilities.ReserveTag(0x2375d3d9 /* tag_933pz */))) { return; } if (scope.IsTransaction) { m_eventSource.LogEvent(Categories.TimingGeneral, name: scope.Name, subtype: scope.SubType ?? NullPlaceholder, metadata: scope.MetaData ?? NullPlaceholder, serviceName: ServiceName ?? NullPlaceholder, result: scope.Result, correlationId: data.VisibleId.ToString("D", CultureInfo.InvariantCulture), durationMs: scope.DurationInMilliseconds); } else { m_eventSource.LogEvent(Categories.TimingGeneral, name: scope.Name, subtype: scope.SubType ?? NullPlaceholder, metadata: scope.MetaData ?? NullPlaceholder, serviceName: ServiceName ?? NullPlaceholder, userHash: data.Data(TimedScopeDataKeys.InternalOnly.UserHash) ?? data.UserHash ?? NullPlaceholder, result: scope.Result, correlationId: data.VisibleId.ToString("D", CultureInfo.InvariantCulture), durationMs: scope.DurationInMilliseconds); } }
/// <summary> /// Logs the scope end /// </summary> /// <param name="scope">Scope to log</param> /// <param name="data">Correlation data</param> public void LogScopeEnd(TimedScope scope, CorrelationData data) { if (scope == null) { return; } TimedScopeLogEvent evt = new TimedScopeLogEvent(scope.Name, scope.SubType, scope.MetaData, scope.Result, scope.FailureDescription, data.Data(TimedScopeDataKeys.InternalOnly.UserHash), scope.Duration ?? TimeSpan.Zero); m_events.Enqueue(evt); }