-
Notifications
You must be signed in to change notification settings - Fork 5k
Rename collectPerfCounters to collectMetrics in browser runtime #115926
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
Conversation
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>
@ copilot search whole repository for |
Co-authored-by: pavelsavara <271576+pavelsavara@users.noreply.github.com>
Found and updated the remaining instance of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the JavaScript API from collectPerfCounters to collectMetrics to more accurately reflect the metrics collected in the browser runtime, aligning the API name with its cross-platform functionality.
- Renamed the API in documentation (features.md)
- Updated type definitions and API exports (index.ts, export-api.ts)
- Modified internal imports and function calls to use the new name (diagnostics/index.ts, dotnet-counters.ts, diagnostics-js.ts)
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/mono/wasm/features.md | Updated example usage to reflect the new function name |
src/mono/browser/runtime/types/index.ts | Renamed API type definition from collectPerfCounters to collectMetrics |
src/mono/browser/runtime/export-api.ts | Updated API export property from collectPerfCounters to collectMetrics |
src/mono/browser/runtime/diagnostics/index.ts | Fixed internal diagnostic mapping for the new API name |
src/mono/browser/runtime/diagnostics/dotnet-counters.ts | Renamed the function from collectPerfCounters to collectMetrics |
src/mono/browser/runtime/diagnostics/diagnostics-js.ts | Updated import and function call to use collectMetrics |
This PR renames the
collectPerfCounters
JavaScript API tocollectMetrics
to better reflect what it's collecting.Why the change?
Performance Counters were a Windows-specific .NET Framework feature (docs), but in later versions of .NET, they were replaced with a cross-platform Metrics model (docs).
The JS API was originally named after the older Windows-specific feature, but it's actually collecting the modern cross-platform metrics that can be used on any platform. The new name more accurately reflects the functionality.
Changes made
src/mono/browser/runtime/diagnostics/dotnet-counters.ts
Fixes #115472.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.