dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.06k stars 4.04k forks source link

Capture source generator statistics #59176

Open JeffAshton opened 2 years ago

JeffAshton commented 2 years ago

Brief description:

Recently started using the ReportAnalyzer command line argument and noticed that no information about source generators was included. This would be amazing data to have.

A separate command line argument for source generators or just include a section about source generators similar to analyzers would work:

Total analyzer execution time: 0.400 seconds.
NOTE: Elapsed time may be less than analyzer execution time because analyzers can run concurrently.

Time (s)    %   Analyzer
   0.058   14   Microsoft.CodeAnalysis.NetAnalyzers, Version=6.0.5.1901, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   0.003   <1      Microsoft.NetCore.Analyzers.Runtime.BufferBlockCopyLengthAnalyzer (CA2018)
   0.020    4      Microsoft.NetCore.Analyzers.InteropServices.PlatformCompatibilityAnalyzer (CA1416)

   0.046   11   Microsoft.CodeAnalysis.CSharp.BannedApiAnalyzers, Version=3.3.5.2003, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   0.024    5      Microsoft.CodeAnalysis.CSharp.BannedApiAnalyzers.CSharpSymbolIsBannedAnalyzer (RS0030, RS0031)
   0.023    5      Microsoft.CodeAnalysis.CSharp.BannedApiAnalyzers.CSharpRestrictedInternalsVisibleToAnalyzer (RS0035)
jinujoseph commented 2 years ago

Duplicate of #55580

jinujoseph commented 2 years ago

cc @jasonmalinowski

jasonmalinowski commented 2 years ago

Althogh similar to 55580 let's keep this as a reminder to also update the other flag too.

chsienki commented 2 years ago

Related: #60347 #60267