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

Introduce a diagnosis tool #60

Merged
merged 5 commits into from
Dec 7, 2022
Merged

Introduce a diagnosis tool #60

merged 5 commits into from
Dec 7, 2022

Conversation

theofidry
Copy link
Owner

@theofidry theofidry commented Dec 7, 2022

Introduce a way to diagnose a finder, i.e. get information about what a specific finder may find. Those are then aggregated and but run all by a diagnoser.

The idea of this tool is to provide a quick insight on how each finder will operator. For example on my machine:

$ make diagnose
./bin/diagnose.php
Running diagnosis...

CpuInfoFinder: 
--------------------------------------------
The file "/proc/cpuinfo" could not be found.
--------------------------------------------

DummyCpuCoreFinder(value=1): 
----------------
Will return "1".
----------------

HwLogicalFinder: 
---------------------------------------------------------------------------------
Executed the command "sysctl -n hw.logicalcpu 2>&1" and got the following output:
8

---------------------------------------------------------------------------------

HwPhysicalFinder: 
----------------------------------------------------------------------------------
Executed the command "sysctl -n hw.physicalcpu 2>&1" and got the following output:
8

----------------------------------------------------------------------------------

NProcFinder(all=true): 
----------------------------------------------------
The command "nproc --all" gave the following output:
8

----------------------------------------------------

NProcFinder(all=false): 
----------------------------------------------
The command "nproc" gave the following output:
8

----------------------------------------------

NullCpuCoreFinder: 
-------------------
Will return "null".
-------------------

WindowsWmicPhysicalFinder: 
--------------------------------------------------------------------------------------------------------------------------------------
Executed the command "wmic cpu get NumberOfProcessors 2>&1" which exited with a non-success exit code (127) with the following output:
sh: wmic: command not found

--------------------------------------------------------------------------------------------------------------------------------------

WindowsWmicLogicalFinder: 
---------------------------------------------------------------------------------------------------------------------------------------------
Executed the command "wmic cpu get NumberOfLogicalProcessors 2>&1" which exited with a non-success exit code (127) with the following output:
sh: wmic: command not found

---------------------------------------------------------------------------------------------------------------------------------------------


It also allows to execute each finders:

$ make execute
./bin/execute.php
Executing finders...

CpuInfoFinder: NULL
DummyCpuCoreFinder(value=1): 1
HwLogicalFinder: 8
HwPhysicalFinder: 8
NProcFinder(all=true): 8
NProcFinder(all=false): 8
NullCpuCoreFinder: NULL
WindowsWmicPhysicalFinder: NULL
WindowsWmicLogicalFinder: NULL

With this, it should be easy to test it on a specific system.

@theofidry theofidry changed the title Feature/diagnose Introduce a diagnosis tool Dec 7, 2022
@theofidry theofidry enabled auto-merge (squash) December 7, 2022 23:03
@theofidry theofidry merged commit 7a6740d into main Dec 7, 2022
@theofidry theofidry deleted the feature/diagnose branch December 7, 2022 23:03
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