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

Fire an ETW event when the background document generator queue is empty #11233

Merged

Conversation

davidwengier
Copy link
Contributor

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.Sleeping. 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 davidwengier requested a review from a team as a code owner November 20, 2024 05:18

namespace Microsoft.AspNetCore.Razor;

[EventSource(Name = "RazorEventSource")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative to this would just be to steal Roslyn's event source name, or even just use the code markers guid. Not sure what the etiquette there is :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a new EventSource makes sense, it makes it easier not to accidently collide with their events.


namespace Microsoft.AspNetCore.Razor;

[EventSource(Name = "RazorEventSource")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a new EventSource makes sense, it makes it easier not to accidently collide with their events.

delay,
processBatchAsync: ProcessBatchAsync,
equalityComparer: null,
idleAction: () => RazorEventSource.Instance.BackgroundDocumentGeneratorIdle(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think you can just pass the method group here rather than wrapping it in a lambda.

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

Successfully merging this pull request may close these issues.

5 participants