Skip to content

Commit c1042ee

Browse files
committed
Updates
1 parent 0b8ab11 commit c1042ee

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

aspnetcore/blazor/performance/webassembly-event-pipe-diagnostics.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ The MSBuild properties in the following table enable profiler integration.
4242
Property | Default | Set value to… | Description
4343
--- | :---: | :---: | ---
4444
`<WasmPerfTracing>` | `false` | `true` | Controls diagnostic server tracing.
45-
`<WasmPerfInstrumentation>` | `false` | `true` | Controls CPU sampling instrumentation for diagnostic server. Not necessary for memory dump or counters. **Makes the app execute slower. Only set this to `true` for performance profiling.**
4645
`<MetricsSupport>` | `false` | `true` | Controls `System.Diagnostics.Metrics` support. For more information, see the [`System.Diagnostics.Metrics` namespace](/dotnet/api/system.diagnostics.metrics).
4746
`<EventSourceSupport>` | `false`| `true` | Controls `EventPipe` support. For more information, see [Diagnostics and instrumentation: Observability and telemetry](/dotnet/core/deploying/native-aot/diagnostics#observability-and-telemetry).
4847

@@ -53,7 +52,6 @@ In the app's project file (`.csproj`):
5352
```xml
5453
<PropertyGroup Condition="'$(BlazorSampleProfilingEnabled)' == 'true'">
5554
<WasmPerfTracing>true</WasmPerfTracing>
56-
<WasmPerfInstrumentation>true</WasmPerfInstrumentation>
5755
<MetricsSupport>true</MetricsSupport>
5856
<EventSourceSupport>true</EventSourceSupport>
5957
</PropertyGroup>
@@ -71,6 +69,16 @@ The [`Timing-Allow-Origin` HTTP header](https://developer.mozilla.org/docs/Web/H
7169

7270
[EventPipe](/dotnet/core/diagnostics/eventpipe) is a runtime component used to collect tracing data, similar to [ETW](/windows/win32/etw/event-tracing-portal) and [perf_events](https://wikipedia.org/wiki/Perf_%28Linux%29).
7371

72+
Use the `<WasmPerfInstrumentation>` property to enable CPU sampling instrumentation for diagnostic server. This setting isn't necessary for memory dump or counters. **Makes the app execute slower. Only set this to `true` for performance profiling.**
73+
74+
Enabling profilers has negative size and performance impact, so don't publish an app for production with profilers enabled. In the following example, a condition is set on a property group section that only enables profiling when the app is built with `/p:BlazorSampleProfilingEnabled=true` (.NET CLI) or `<BlazorSampleProfilingEnabled>true</BlazorSampleProfilingEnabled>` in a Visual Studio publish profile, where "`BlazorSampleProfilingEnabled`" is a custom symbol name that you choose and doesn't conflict with other symbol names.
75+
76+
```xml
77+
<PropertyGroup Condition="'$(BlazorSampleProfilingEnabled)' == 'true'">
78+
<WasmPerfInstrumentation>true</WasmPerfInstrumentation>
79+
</PropertyGroup>
80+
```
81+
7482
Collect CPU counters for 60 seconds with `collectCpuSamples(durationSeconds)`:
7583

7684
```javascript

0 commit comments

Comments
 (0)