-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fire an ETW event when the background document generator queue is emp…
…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 :)
- Loading branch information
Showing
4 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/RazorEventSource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT license. See License.txt in the project root for license information. | ||
|
||
using System.Diagnostics.Tracing; | ||
|
||
namespace Microsoft.AspNetCore.Razor; | ||
|
||
[EventSource(Name = "RazorEventSource")] | ||
internal sealed class RazorEventSource : EventSource | ||
{ | ||
public static readonly RazorEventSource Instance = new(); | ||
|
||
private RazorEventSource() | ||
{ | ||
} | ||
|
||
[Event(1, Level = EventLevel.Informational)] | ||
public void BackgroundDocumentGeneratorIdle() => WriteEvent(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters