Skip to content

Commit f02f26c

Browse files
committed
Updates
1 parent c69cc66 commit f02f26c

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

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

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,42 +26,6 @@ Install the [.NET WebAssembly build tools](xref:blazor/tooling/webassembly#net-w
2626
dotnet workload install wasm-tools
2727
```
2828

29-
## EventPipe profiler
30-
31-
[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).
32-
33-
Collect CPU counters for 60 seconds with `collectCpuSamples(durationSeconds)`:
34-
35-
```javascript
36-
globalThis.getDotnetRuntime(0).collectCpuSamples({durationSeconds: 60});
37-
```
38-
39-
## GC (Garbage Collector) dumps
40-
41-
Manual testing:
42-
43-
* Browser developer tools: Download the `.json` output file, open the file in Visual Studio, and find the expected classes.
44-
* [`dotnet-gcdump` (`collect`/convert` options)](/dotnet/core/diagnostics/dotnet-gcdump): To view the captured GC dump files, see [View the GC dump captured from dotnet-gcdump](/dotnet/core/diagnostics/dotnet-gcdump#view-the-gc-dump-captured-from-dotnet-gcdump).
45-
46-
Collect a GC (Garbage Collector) dump of the live .NET process with `collectGcDump`:
47-
48-
```javascript
49-
globalThis.getDotnetRuntime(0).collectGcDump();
50-
```
51-
52-
## Counters trace
53-
54-
Manual testing:
55-
56-
* Browser developer tools: Download the `.json` output file, open the file in Visual Studio, and find the expected counters.
57-
* [`dotnet-counters collect`](/dotnet/core/diagnostics/dotnet-counters): Open the `.csv`/`.json` output file in Visual Studio and find the expected counters.
58-
59-
Collect diagnostic counters for 60 seconds with `collectPerfCounters(durationSeconds)`:
60-
61-
```javascript
62-
globalThis.getDotnetRuntime(0).collectPerfCounters({durationSeconds: 60});
63-
```
64-
6529
## .NET Core Diagnostics Client Library example
6630

6731
Parse and validate NetTrace (`.nettrace`) messages using the .NET Core Diagnostics Client Library:
@@ -103,6 +67,42 @@ Alternatively, enable features when the app is built with the .NET CLI. The foll
10367

10468
The [`Timing-Allow-Origin` HTTP header](https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/Timing-Allow-Origin) allows for more precise time measurements.
10569

70+
## EventPipe profiler
71+
72+
[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).
73+
74+
Collect CPU counters for 60 seconds with `collectCpuSamples(durationSeconds)`:
75+
76+
```javascript
77+
globalThis.getDotnetRuntime(0).collectCpuSamples({durationSeconds: 60});
78+
```
79+
80+
To view the trace, see [Use EventPipe to trace your .NET application](/dotnet/core/diagnostics/eventpipe#use-eventpipe-to-trace-your-net-application).
81+
82+
## GC (Garbage Collector) dumps
83+
84+
The [`dotnet-gcdump` (`collect`/convert` options)](/dotnet/core/diagnostics/dotnet-gcdump) global tool collects GC (Garbage Collector) dumps of live .NET processes using [EventPipe](/dotnet/core/diagnostics/eventpipe).
85+
86+
Collect a GC (Garbage Collector) dump of the live .NET process with `collectGcDump`:
87+
88+
```javascript
89+
globalThis.getDotnetRuntime(0).collectGcDump();
90+
```
91+
92+
To view the captured GC dump, see [View the GC dump captured from dotnet-gcdump](/dotnet/core/diagnostics/dotnet-gcdump#view-the-gc-dump-captured-from-dotnet-gcdump).
93+
94+
## Counters trace
95+
96+
[`dotnet-counters collect`](/dotnet/core/diagnostics/dotnet-counters) is a performance monitoring tool for ad-hoc health monitoring and first-level performance investigation.
97+
98+
Collect diagnostic counters for 60 seconds with `collectPerfCounters(durationSeconds)`:
99+
100+
```javascript
101+
globalThis.getDotnetRuntime(0).collectPerfCounters({durationSeconds: 60});
102+
```
103+
104+
To view the trace, see [Use EventPipe to trace your .NET application](/dotnet/core/diagnostics/eventpipe#use-eventpipe-to-trace-your-net-application).
105+
106106
## Additional resources
107107

108108
* [What diagnostic tools are available in .NET Core?](/dotnet/core/diagnostics/)

0 commit comments

Comments
 (0)