-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(core): collect resource usage #32946
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
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit ee2e174
☁️ Nx Cloud last updated this comment at |
56d3594 to
64cab2a
Compare
|
Failed to publish a PR release of this pull request, triggered by @leosvelperez. |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-32946-64cab2a
To request a new release for this pull request, mention someone from the Nx team or the |
64cab2a to
f123370
Compare
f123370 to
2c39095
Compare
9ee1187 to
b2bcab9
Compare
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.
Nx Cloud has identified a possible root cause for your failed CI:
The failing test "should be able to create an web-components workspace" is unrelated to the pull request changes.
The PR introduces a resource usage collection feature that adds metrics tracking for processes during task execution. The implementation includes:
- Process metrics collector in Rust
- Registration of CLI, daemon, and task processes
- Silent failure handling (try-catch blocks) to ensure metrics never break execution
The test failure shows a Corepack error about missing packageManager field during workspace creation with pnpm. This failure is classified as flaky_task because:
- No logical connection: The PR modifies process metrics collection during task execution, not workspace creation or package.json handling
- Inconsistent behavior: 4 out of 5 similar tests passed (express, react-native, expo, nest), only web-components failed
- External tool error: The error originates from Corepack/pnpm, not from Nx code
- No reproducibility: The empty similar_task_failures indicates this error doesn't appear consistently
- Defensive coding: All metrics registration code is wrapped in try-catch blocks that silently fail
The web-components test is exhibiting non-deterministic behavior likely due to timing issues, Corepack state, or external registry conditions. The PR's metrics collection feature operates independently and cannot cause Corepack to modify packageManager field validation behavior during workspace creation.
A code change would likely not resolve this issue, so no action was taken.
⚙️ An Nx Cloud workspace admin can disable these reviews in workspace settings.
b2bcab9 to
2118cbf
Compare
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-32946-2118cbf
To request a new release for this pull request, mention someone from the Nx team or the |
|
|
||
| /// The main collection loop that runs in a separate thread | ||
| /// Discovers current metrics and directly notifies subscribers (true push-based) | ||
| fn collection_loop( |
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.
Check if &mut self can be used here
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.
We can't use &mut self here because the function runs in a separate thread that needs to own its data. We can't pass references across thread boundaries due to Rust's ownership rules.
2118cbf to
614b701
Compare
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-32946-614b701
To request a new release for this pull request, mention someone from the Nx team or the |
614b701 to
d826fce
Compare
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-32946-4176704
To request a new release for this pull request, mention someone from the Nx team or the |
4176704 to
ee2e174
Compare
Adds resource usage collection while running tasks.