Skip to content

Commit e6fae23

Browse files
committed
Updates
1 parent 45c2d58 commit e6fae23

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

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

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,23 @@ For more information, see the [.NET Core diagnostics documentation](/dotnet/core
6262

6363
[!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]
6464

65-
The following example:
65+
Collect a GC (Garbage Collector) dump of the live .NET process with `collectGcDump`:
6666

67-
* Collects a GC (Garbage Collector) dump of the live .NET process.
68-
* Collects diagnostic counters for 60 seconds.
69-
* Collects CPU counters for 60 seconds.
67+
```javascript
68+
globalThis.getDotnetRuntime(0).collectGcDump();
69+
```
70+
71+
Collect diagnostic counters for 60 seconds with `collectPerfCounters(durationSeconds)`:
72+
73+
```javascript
74+
globalThis.getDotnetRuntime(0).collectPerfCounters({durationSeconds: 60});
75+
```
76+
77+
Collect CPU counters for 60 seconds with `collectCpuSamples(durationSeconds)`:
78+
79+
```javascript
80+
globalThis.getDotnetRuntime(0).collectCpuSamples({durationSeconds: 60});
81+
```
7082

7183
The MSBuild properties in the following table enable profiler integration.
7284

@@ -98,26 +110,6 @@ Alternatively, enable features when the app is built with the .NET CLI. The foll
98110

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

101-
Browser developer tools console calls in the following example that trigger profiling:
102-
103-
* `collectGcDump`: Collect a GC (Garbage Collector) dump.
104-
105-
```javascript
106-
globalThis.getDotnetRuntime(0).collectGcDump();
107-
```
108-
109-
* `collectPerfCounters(durationSeconds)`: Collect general diagnostic counters.
110-
111-
```javascript
112-
globalThis.getDotnetRuntime(0).collectPerfCounters({durationSeconds: 60});
113-
```
114-
115-
* `collectCpuSamples(durationSeconds)`: Collect CPU diagnostic counters.
116-
117-
```javascript
118-
globalThis.getDotnetRuntime(0).collectCpuSamples({durationSeconds: 60});
119-
```
120-
121113
## Additional resources
122114

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

0 commit comments

Comments
 (0)