-
Notifications
You must be signed in to change notification settings - Fork 199
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
Fire an ETW event when the background document generator queue is empty #11233
Conversation
…ty, after doing some work
|
||
namespace Microsoft.AspNetCore.Razor; | ||
|
||
[EventSource(Name = "RazorEventSource")] |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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")] |
There was a problem hiding this comment.
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.
...Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/AsyncBatchingWorkQueue`2.cs
Outdated
Show resolved
Hide resolved
...Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/AsyncBatchingWorkQueue`2.cs
Outdated
Show resolved
Hide resolved
...rc/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/BackgroundDocumentGenerator.cs
Outdated
Show resolved
Hide resolved
delay, | ||
processBatchAsync: ProcessBatchAsync, | ||
equalityComparer: null, | ||
idleAction: () => RazorEventSource.Instance.BackgroundDocumentGeneratorIdle(), |
There was a problem hiding this comment.
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.
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 :)