Skip to content

[browser] event pipe - JavaScript part #110818

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

Merged
merged 9 commits into from
Apr 8, 2025

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Dec 18, 2024

usage

    <WasmPerfTracing>true</WasmPerfTracing>
    <WasmPerfInstrumentation>N:Sample</WasmPerfInstrumentation>
    <MetricsSupport>true</MetricsSupport>
    <EventSourceSupport>true</EventSourceSupport>

browser dev tools console usage

globalThis.getDotnetRuntime(0).collectGcDump()
globalThis.getDotnetRuntime(0).collectPerfCounters({durationSeconds: 60})
globalThis.getDotnetRuntime(0).collectCpuSamples({durationSeconds: 60})

host machine usage

dotnet.withEnvironmentVariable("DOTNET_DiagnosticPorts", "ws://127.0.0.1:8088/diagnostics")
dotnet-dsrouter server-websocket -ws http://127.0.0.1:8088/diagnostics
dotnet-gcdump collect -v -p 29364
dotnet-trace collect -p 29364
dotnet-counters collect -p 29364

Implementation

  • client side JS implementation of dotnet-gcdump, dotnet-trace, dotnet-counters, this is about formating binary messages that DS/EP could understand.
  • WebSocket connectivity to ds-rounter
  • in-tree sample browser-eventpipe
  • mono_wasm_process_current_pid

Contributes to #76316

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Diagnostics-mono os-browser Browser variant of arch-wasm labels Dec 18, 2024
@pavelsavara pavelsavara added this to the 10.0.0 milestone Dec 18, 2024
@pavelsavara pavelsavara self-assigned this Dec 18, 2024
@ghost
Copy link

ghost commented Dec 18, 2024

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
@ghost
Copy link

ghost commented Dec 18, 2024

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@pavelsavara pavelsavara requested a review from maraf April 4, 2025 14:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 16 out of 19 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj: Language not supported
  • src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj: Language not supported
  • src/mono/sample/wasm/browser-eventpipe/index.html: Language not supported

pavelsavara and others added 2 commits April 4, 2025 16:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@javiercn
Copy link
Member

javiercn commented Apr 4, 2025

-p 29364

This is the PID of the dsrouter, isn't it?

Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just naming nits

- implement EP cookie
- mono_wasm_process_current_pid
Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to my limited understanding of this area.

Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@pavelsavara
Copy link
Member Author

/ba-g CI timeouts

@pavelsavara pavelsavara merged commit 073fcb3 into dotnet:main Apr 8, 2025
65 of 71 checks passed
@pavelsavara pavelsavara deleted the browser_st_ep branch April 8, 2025 12:48
@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Diagnostics-mono os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants