Log telemetry item when parse or compilation options change#48215
Log telemetry item when parse or compilation options change#48215davidwengier merged 9 commits intodotnet:masterfrom
Conversation
src/VisualStudio/Core/Def/Telemetry/AbstractWorkspaceTelemetryService.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs
Outdated
Show resolved
Hide resolved
|
ping @jasonmalinowski this is ready for re-review |
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs
Outdated
Show resolved
Hide resolved
…tudioProject.cs Co-authored-by: Jason Malinowski <jason@jason-m.com>
|
Hello @davidwengier! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs
Outdated
Show resolved
Hide resolved
sharwell
left a comment
There was a problem hiding this comment.
Still reviewing performance impact
…tudioProject.cs Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
| /// </summary> | ||
| private static void TryReportCompilationThrownAway(SolutionState solutionState, ProjectId projectId) | ||
| { | ||
| // We log the number of syntax trees that have been parsed even if there was no compilation created yet |
There was a problem hiding this comment.
❔ Why are we gathering this in telemetry instead of just capturing the information as part of ETL traces submitted with performance reports? See #38194 for an example of a related case.
There was a problem hiding this comment.
I guess I don't know. I don't know what a "performance report" is. Is that something @panopticoncentral can read? If there is already a system in place for collecting this information then that's great, and I guess its a matter of telling Paul where to get that data?
My understanding was that this telemetry event would be used as part of other telemetry events that come from CPS, VS, possibly Nuget, to get a handle on what possible wasted work might be happening on solution load.
There was a problem hiding this comment.
The thought was to be able to construct models of solution opens across the telemetry, rather than only being able to do it for explicitly captured traces.
There was a problem hiding this comment.
What steps are in place to ensure this telemetry can be disabled if it is observed to produce large amounts of data and/or have an observable impact on client load times? Roslyn aims for these operations to be efficient (i.e. throwing away a Compilation is part of the normal fast path), so putting a telemetry invocation on the path seems to defeat its goal.
There was a problem hiding this comment.
One early option would disabling this telemetry if IsFullyLoadedAsync is true:
This minimizes the impact of telemetry collection to a worst-case scenario of slower solution opening, while allowing us to expand the collection in the future if we both 1) demonstrate that it is not expensive and 2) demonstrate that analysis is in place such that the additional data is likely to directly result in a better future product.
There was a problem hiding this comment.
Definitely this is only needed for solution open initially, and I agree, the aim was to add a little bit of telemetry now and add more only if it proves useful. That's why this is limited to changes that don't happen often during "normal" use. I'm fine with adding an explicit check for fully-loaded-ness.
There was a problem hiding this comment.
That is annoyingly async. Is this pattern acceptable here? I would assume we don't want to block anything here.
There was a problem hiding this comment.
Yes that pattern is fine. Also can file a bug for me to just make IsFullyLoadedAsync a synchronous method so this is handled automatically.
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs
Outdated
Show resolved
Hide resolved
|
@davidwengier Two follow-up issues to file:
|
|
Thanks all! |
Fixes AB#1171932
This logs some basic telemetry about how many parsed trees there are, and whether there was an existing compilation, when compilation options, parse options or assembly name is changed.
This is for @panopticoncentral to identify wasted work during solution load.