Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Telemetry Event / CodeMarker when Razor is ready #11232

Open
WardenGnaw opened this issue Nov 20, 2024 · 2 comments
Open

Add Telemetry Event / CodeMarker when Razor is ready #11232

WardenGnaw opened this issue Nov 20, 2024 · 2 comments
Assignees
Labels
feature request Large improvement request

Comments

@WardenGnaw
Copy link

WardenGnaw commented Nov 20, 2024

Summary

Add a new event similar to dotnet/razor/taghelperresolve/end but is close to when Razor has completed discovering all of the razor components in a project,

Background and Motivation

During Automated Testing, when Visual Studio loads a solution, the LSP is running analysis in the background async. However, if the test infrastructure is trying to prevent regression of memory usage, things that happen asynchronously make it difficult to have a stable memory usage trace.

Right now, the tests are using Thread.Sleep(seconds) which is not the best way to capture regressions that may happen and not reliable.

This used to be done by #3110

Proposed Feature

Add a new event like dotnet/razor/taghelperresolve/end or a CodeMarker .

Alternative Designs

Some service that we can call that will wait when Razor is ready.

@WardenGnaw WardenGnaw added the feature request Large improvement request label Nov 20, 2024
@davidwengier davidwengier transferred this issue from dotnet/roslyn Nov 20, 2024
@davidwengier davidwengier self-assigned this Nov 20, 2024
@davidwengier
Copy link
Contributor

Going to start this with an event telling us that the background document generator has nothing in its queue.

davidwengier added a commit that referenced this issue Nov 21, 2024
…ty (#11233)

I was musing the other day about ETW events possibly being useful in
tracking down the Speedometer regression I was looking in to, and then
along comes #11232 which is a
great excuse to add some ETW event infrastructure to our lives.

The idea here is that RPS/Speedometer tests can wait for Razor to be
"ready" by looking for this event, rather than `Thread.Sleep`ing.
Anecdotally on my machine, when loading OrchardCore, this event fires
once a couple of minutes after solution load, so seems like a reasonable
candidate.

Once this is in @WardenGnaw will try it out and if it's not good, we'll
pop some more events somewhere.

Will need to follow up with PR(s?) to add this event source name to the
list, but I need to work out where to do that first :)
@davidwengier
Copy link
Contributor

ETW event added in #11233, will close this once we learn if it is sufficient, or there is more work to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Large improvement request
Projects
None yet
Development

No branches or pull requests

3 participants