CodeFixes\Service\CodeFixService.cs (9)
97using var _ = RoslynTelemetry.Current.RecordBlockTime(FunctionId.CodeFix_Summary, $"Pri{priority.GetPriorityInt()}.{nameof(GetMostSevereFixAsync)}");
102FunctionId.CodeFix_Summary, $"Pri{priority.GetPriorityInt()}.{nameof(GetMostSevereFixAsync)}.{nameof(IDiagnosticAnalyzerService.GetDiagnosticsForSpanAsync)}"))
172using var _ = RoslynTelemetry.Current.RecordBlockTime(FunctionId.CodeFix_Summary, $"Pri{priority.GetPriorityInt()}");
191FunctionId.CodeFix_Summary, $"Pri{priority.GetPriorityInt()}.{nameof(IDiagnosticAnalyzerService.GetDiagnosticsForSpanAsync)}"))
270using var _ = RoslynTelemetry.Current.RecordBlockTime(FunctionId.CodeFix_Summary, $"{nameof(GetDocumentFixAllForIdInSpanAsync)}");
280FunctionId.CodeFix_Summary, $"{nameof(GetDocumentFixAllForIdInSpanAsync)}.{nameof(IDiagnosticAnalyzerService.GetDiagnosticsForSpanAsync)}"))
518using var _ = RoslynTelemetry.Current.LogBlockTime(FunctionId.CodeFix_Delay, logMessage, CodeFixTelemetryDelay);
527using (RoslynEventSource.LogInformationalBlock(FunctionId.CodeFixes_GetCodeFixesAsync, fixerName, cancellationToken))
735using (RoslynEventSource.LogInformationalBlock(FunctionId.CodeFixes_GetCodeFixesAsync, provider, cancellationToken))
Diagnostics\Service\DocumentAnalysisExecutor.cs (4)
104Logger.Log(FunctionId.Diagnostics_SyntaxDiagnostic,
117Logger.Log(FunctionId.Diagnostics_SemanticDiagnostic, static (a, d, e) => $"{a}, ({d.Id}, {d.Project.Id}), Enabled:{e}", analyzer, textDocument, isEnabled);
219using var _ = RoslynTelemetry.Current.RecordBlockTime(FunctionId.RequestDiagnostics_Summary, $"{nameof(GetSyntaxDiagnosticsInProcessAsync)}.{nameof(GetAnalysisResultInProcessAsync)}");
255using var _ = RoslynTelemetry.Current.RecordBlockTime(FunctionId.RequestDiagnostics_Summary, $"{nameof(GetSemanticDiagnosticsInProcessAsync)}.{nameof(GetAnalysisResultInProcessAsync)}");
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerLogger.cs (12)
49Logger.Log(FunctionId.WorkCoordinatorRegistrationService_Register, KeyValueLogMessage.Create(m =>
58Logger.Log(FunctionId.WorkCoordinatorRegistrationService_Unregister, KeyValueLogMessage.Create(m =>
70Logger.Log(FunctionId.WorkCoordinatorRegistrationService_Reanalyze, KeyValueLogMessage.Create(m =>
84FunctionId.IncrementalAnalyzerProcessor_ActiveFileAnalyzers, FunctionId.IncrementalAnalyzerProcessor_ActiveFileAnalyzer,
90FunctionId.IncrementalAnalyzerProcessor_Analyzers, FunctionId.IncrementalAnalyzerProcessor_Analyzer,
96FunctionId analyzersId, FunctionId analyzerId, int correlationId, string workspaceKind, ImmutableArray<IUnitTestingIncrementalAnalyzer> reordered)
122Logger.Log(FunctionId.WorkCoordinator_ShutdownTimeout, KeyValueLogMessage.Create(m =>
133Logger.Log(FunctionId.WorkCoordinator_Shutdown, KeyValueLogMessage.Create(m =>
188Logger.Log(FunctionId.IncrementalAnalyzerProcessor_Shutdown, KeyValueLogMessage.Create(m =>
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (5)
132Logger.Log(FunctionId.WorkCoordinator_SemanticChange_EnqueueFromType, symbol.Name);
159Logger.Log(FunctionId.WorkCoordinator_SemanticChange_EnqueueFromMember, symbol.Name);
240Logger.Log(FunctionId.WorkCoordinator_SemanticChange_FullProjects, internalVisibleToAssembly == null ? "full" : "internals");
263Logger.Log(FunctionId.WorkCoordinator_SemanticChange_Enqueue, s_enqueueLogger, Environment.TickCount, documentId, changedMember != null);
379Logger.Log(FunctionId.WorkCoordinator_Project_Enqueue, s_enqueueLogger, Environment.TickCount, projectId);
CodeCleanup\AbstractCodeCleanerService.cs (6)
31using (Logger.LogBlock(FunctionId.CodeCleanup_CleanupAsync, cancellationToken))
75using (Logger.LogBlock(FunctionId.CodeCleanup_Cleanup, cancellationToken))
462using (Logger.LogBlock(FunctionId.CodeCleanup_IterateAllCodeCleanupProviders, cancellationToken))
494using (Logger.LogBlock(FunctionId.CodeCleanup_IterateOneCodeCleanup, GetCodeCleanerTypeName, codeCleaner, cancellationToken))
544using (Logger.LogBlock(FunctionId.CodeCleanup_IterateAllCodeCleanupProviders, cancellationToken))
571using (Logger.LogBlock(FunctionId.CodeCleanup_IterateOneCodeCleanup, GetCodeCleanerTypeName, codeCleaner, cancellationToken))
Log\EtwEventSink.cs (8)
13/// A sink that publishes events to ETW using an EventSource. Opt-in per <see cref="FunctionId"/>, via
16internal sealed class EtwEventSink(Func<FunctionId, bool> isEnabledPredicate) : IEventSink
22public bool IsEnabled(FunctionId functionId)
27if (IsEnabled(FunctionId.NonFatalWatson))
28_source.Log(exception.ToString(), FunctionId.NonFatalWatson);
31public void Log(FunctionId functionId, LogMessage logMessage)
34public void LogBlockStart(FunctionId functionId, LogMessage logMessage, int uniquePairId, CancellationToken cancellationToken)
37public void LogBlockEnd(FunctionId functionId, LogMessage logMessage, int uniquePairId, int delta, CancellationToken cancellationToken)
Log\TraceEventSink.cs (8)
16internal sealed class TraceEventSink(Func<FunctionId, bool> isEnabledPredicate) : IEventSink
18public bool IsEnabled(FunctionId functionId)
23if (IsEnabled(FunctionId.NonFatalWatson))
24Log(FunctionId.NonFatalWatson, exception.ToString());
27public void Log(FunctionId functionId, LogMessage logMessage)
30public void LogBlockStart(FunctionId functionId, LogMessage logMessage, int uniquePairId, CancellationToken cancellationToken)
33public void LogBlockEnd(FunctionId functionId, LogMessage logMessage, int uniquePairId, int delta, CancellationToken cancellationToken)
40private static void Log(FunctionId functionId, string message)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (30)
15/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, string, LogLevel)"/>
16public static void Log(FunctionId functionId, string? message = null, LogLevel logLevel = LogLevel.Debug)
19/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, Func{string}, LogLevel)"/>
20public static void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug)
23/// <inheritdoc cref="RoslynTelemetry.Log{TArg}(FunctionId, Func{TArg, string}, TArg, LogLevel)"/>
24public static void Log<TArg>(FunctionId functionId, Func<TArg, string> messageGetter, TArg arg, LogLevel logLevel = LogLevel.Debug)
27/// <inheritdoc cref="RoslynTelemetry.Log{TArg0, TArg1}(FunctionId, Func{TArg0, TArg1, string}, TArg0, TArg1, LogLevel)"/>
28public static void Log<TArg0, TArg1>(FunctionId functionId, Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, LogLevel logLevel = LogLevel.Debug)
31/// <inheritdoc cref="RoslynTelemetry.Log{TArg0, TArg1, TArg2}(FunctionId, Func{TArg0, TArg1, TArg2, string}, TArg0, TArg1, TArg2, LogLevel)"/>
32public static void Log<TArg0, TArg1, TArg2>(FunctionId functionId, Func<TArg0, TArg1, TArg2, string> messageGetter, TArg0 arg0, TArg1 arg1, TArg2 arg2, LogLevel logLevel = LogLevel.Debug)
35/// <inheritdoc cref="RoslynTelemetry.Log{TArg0, TArg1, TArg2, TArg3}(FunctionId, Func{TArg0, TArg1, TArg2, TArg3, string}, TArg0, TArg1, TArg2, TArg3, LogLevel)"/>
36public static void Log<TArg0, TArg1, TArg2, TArg3>(FunctionId functionId, Func<TArg0, TArg1, TArg2, TArg3, string> messageGetter, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, LogLevel logLevel = LogLevel.Debug)
39/// <inheritdoc cref="RoslynTelemetry.Log(FunctionId, LogMessage)"/>
40public static void Log(FunctionId functionId, LogMessage logMessage)
43/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, CancellationToken, LogLevel)"/>
44public static IDisposable LogBlock(FunctionId functionId, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
47/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, string, CancellationToken, LogLevel)"/>
48public static IDisposable LogBlock(FunctionId functionId, string? message, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
51/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, Func{string}, CancellationToken, LogLevel)"/>
52public static IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
55/// <inheritdoc cref="RoslynTelemetry.LogBlock{TArg}(FunctionId, Func{TArg, string}, TArg, CancellationToken, LogLevel)"/>
56public static IDisposable LogBlock<TArg>(FunctionId functionId, Func<TArg, string> messageGetter, TArg arg, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
59/// <inheritdoc cref="RoslynTelemetry.LogBlock{TArg0, TArg1}(FunctionId, Func{TArg0, TArg1, string}, TArg0, TArg1, CancellationToken, LogLevel)"/>
60public static IDisposable LogBlock<TArg0, TArg1>(FunctionId functionId, Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
63/// <inheritdoc cref="RoslynTelemetry.LogBlock{TArg0, TArg1, TArg2}(FunctionId, Func{TArg0, TArg1, TArg2, string}, TArg0, TArg1, TArg2, CancellationToken, LogLevel)"/>
64public static IDisposable LogBlock<TArg0, TArg1, TArg2>(FunctionId functionId, Func<TArg0, TArg1, TArg2, string> messageGetter, TArg0 arg0, TArg1 arg1, TArg2 arg2, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
67/// <inheritdoc cref="RoslynTelemetry.LogBlock{TArg0, TArg1, TArg2, TArg3}(FunctionId, Func{TArg0, TArg1, TArg2, TArg3, string}, TArg0, TArg1, TArg2, TArg3, CancellationToken, LogLevel)"/>
68public static IDisposable LogBlock<TArg0, TArg1, TArg2, TArg3>(FunctionId functionId, Func<TArg0, TArg1, TArg2, TArg3, string> messageGetter, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
71/// <inheritdoc cref="RoslynTelemetry.LogBlock(FunctionId, LogMessage, CancellationToken)"/>
72public static IDisposable LogBlock(FunctionId functionId, LogMessage logMessage, CancellationToken token)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\RoslynTelemetry_Metrics.cs (16)
43public void Count(FunctionId functionId, string metricName, long delta = 1)
48public void Count(FunctionId functionId, string metricName, long delta, KeyValuePair<string, object?> tag)
54public void Count(FunctionId functionId, string metricName, long delta, KeyValuePair<string, object?> tag1, KeyValuePair<string, object?> tag2)
60public void Count(FunctionId functionId, string metricName, long delta, KeyValuePair<string, object?> tag1, KeyValuePair<string, object?> tag2, KeyValuePair<string, object?> tag3)
71public void Count(FunctionId functionId, string metricName, long delta, ReadOnlySpan<KeyValuePair<string, object?>> tags)
74private void CountCore(FunctionId functionId, string metricName, long delta, ReadOnlySpan<KeyValuePair<string, object?>> tags)
89public void Record(FunctionId functionId, string metricName, long value)
94public void Record(FunctionId functionId, string metricName, long value, KeyValuePair<string, object?> tag)
100public void Record(FunctionId functionId, string metricName, long value, KeyValuePair<string, object?> tag1, KeyValuePair<string, object?> tag2)
106public void Record(FunctionId functionId, string metricName, long value, KeyValuePair<string, object?> tag1, KeyValuePair<string, object?> tag2, KeyValuePair<string, object?> tag3)
113public void Record(FunctionId functionId, string metricName, long value, ReadOnlySpan<KeyValuePair<string, object?>> tags)
116private void RecordCore(FunctionId functionId, string metricName, long value, ReadOnlySpan<KeyValuePair<string, object?>> tags)
134/// Unlike <see cref="Count(FunctionId, string, long)"/> and <see cref="Record(FunctionId, string, long)"/>
139public IDisposable? RecordBlockTime(FunctionId functionId, string metricName)
158private sealed class TimedBlock(RoslynTelemetry telemetry, FunctionId functionId, string metricName) : IDisposable
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\RoslynTelemetry.cs (18)
118private bool TryGetEnabledSinks(FunctionId functionId, out ImmutableArray<IEventSink> sinks)
131public bool IsEnabled(FunctionId functionId)
134private static void LogToSinks(ImmutableArray<IEventSink> sinks, FunctionId functionId, LogMessage logMessage)
159public void Log(FunctionId functionId, string? message = null, LogLevel logLevel = LogLevel.Debug)
174public void Log(FunctionId functionId, Func<string> messageGetter, LogLevel logLevel = LogLevel.Debug)
189public void Log<TArg>(FunctionId functionId, Func<TArg, string> messageGetter, TArg arg, LogLevel logLevel = LogLevel.Debug)
203public void Log<TArg0, TArg1>(FunctionId functionId, Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, LogLevel logLevel = LogLevel.Debug)
217public void Log<TArg0, TArg1, TArg2>(FunctionId functionId, Func<TArg0, TArg1, TArg2, string> messageGetter, TArg0 arg0, TArg1 arg1, TArg2 arg2, LogLevel logLevel = LogLevel.Debug)
231public void Log<TArg0, TArg1, TArg2, TArg3>(FunctionId functionId, Func<TArg0, TArg1, TArg2, TArg3, string> messageGetter, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, LogLevel logLevel = LogLevel.Debug)
244public void Log(FunctionId functionId, LogMessage logMessage)
265public IDisposable LogBlock(FunctionId functionId, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
271public IDisposable LogBlock(FunctionId functionId, string? message, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
280public IDisposable LogBlock(FunctionId functionId, Func<string> messageGetter, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
289public IDisposable LogBlock<TArg>(FunctionId functionId, Func<TArg, string> messageGetter, TArg arg, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
298public IDisposable LogBlock<TArg0, TArg1>(FunctionId functionId, Func<TArg0, TArg1, string> messageGetter, TArg0 arg0, TArg1 arg1, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
307public IDisposable LogBlock<TArg0, TArg1, TArg2>(FunctionId functionId, Func<TArg0, TArg1, TArg2, string> messageGetter, TArg0 arg0, TArg1 arg1, TArg2 arg2, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
316public IDisposable LogBlock<TArg0, TArg1, TArg2, TArg3>(FunctionId functionId, Func<TArg0, TArg1, TArg2, TArg3, string> messageGetter, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, CancellationToken token, LogLevel logLevel = LogLevel.Trace)
325public IDisposable LogBlock(FunctionId functionId, LogMessage logMessage, CancellationToken token)
Workspace\Solution\DocumentState.cs (4)
136using (Logger.LogBlock(FunctionId.Workspace_Document_State_FullyParseSyntaxTree, s_fullParseLog, filePath, mode, cancellationToken))
152using (Logger.LogBlock(FunctionId.Workspace_Document_State_FullyParseSyntaxTree, s_fullParseLog, filePath, mode, cancellationToken))
198using (Logger.LogBlock(FunctionId.Workspace_Document_State_IncrementallyParseSyntaxTree, cancellationToken))
220using (Logger.LogBlock(FunctionId.Workspace_Document_State_IncrementallyParseSyntaxTree, cancellationToken))