Skip to content
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

feat: Add an easier way to debug #131

Merged
merged 6 commits into from
Jul 29, 2024
Merged

feat: Add an easier way to debug #131

merged 6 commits into from
Jul 29, 2024

Conversation

theofidry
Copy link
Owner

@theofidry theofidry commented Jul 26, 2024

I would like to make cases like PHP-CS-Fixer/PHP-CS-Fixer#8129 easier to debug. There is 3 things to check:

  • If each respective finder behaves as expected, this is the job of the diagnose.php.
  • Which finder result got picked: the introduce CpuCoreFinder::trace() should answer that.
  • A way to debug CpuCoreFinder::getAvailableForParallelisation()*

*: this is more tricky as:

  • the result of the cores count may be memoized
  • it depends on the injected parameters
  • we likely want details of the calculation

What I am thinking is, since #127 is not released yet, I could change the signature of ::getAvailableForParallelisation() to return a result value object which could capture the resolved parameters to be able to figure out with which values the calculation was done.

What I am unsure of, is if it should contain the trace introduced there too, and if done it likely would need to be lazily executed as this would execute several additional system calls.

@theofidry
Copy link
Owner Author

/cc @Wirone in case you're interested in this

@theofidry theofidry marked this pull request as ready for review July 29, 2024 09:03
@theofidry theofidry merged commit c52b2dc into main Jul 29, 2024
20 checks passed
@theofidry theofidry deleted the feat/trace branch July 29, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant