Closed maltfield closed 2 years ago
the cli command needs to be run inside the container:
php external/import.php -f /home/user/some.xhprof
but for that to work you need also add extra bind
-type volumes to container, so the file is accessible inside the container.
the instructions there are old, pre-docker, that assumed you had local installation.
I guess the infrastructure should be re-worked to add cli script to https://github.com/perftools/php-profiler, that could use /run/import
endpoint to submit the .jsonl files.
but for that to work you need also add extra bind-type volumes to container, so the file is accessible inside the container.
Sorry, would you mind expounding on this a bit here in the ticket? For the following command to not throw errors, what exactly should I do?
php external/import.php -f /home/user/some.xhprof
I need to add some lines to a docker file? Which file? Exactly what lines do I need to add so that the container has access to the dependencies it needs to run the above script??
docker-compose exec xhgui sh
.jsonl
file saved by php-profiler, so you need to add a volume, edit docker-compose.yml
and add it, or as config
is already in volume, put the file to config
dir, and then adjust the import command accordingly.but really, as I said already, the import script should be probably moved to https://github.com/perftools/php-profiler project
the import cli program was added to this repo:
if something unclear or broken, open issue there. or just submit pull request.
currently on main branch only.
and documentation update (in this repo):
@glensc first, I do really appreciate your efforts on addressing this issue, especially so fast!
Unfortunately, I think it's now even more unclear to the user how the heck to import .xhprof files into XHGui.
If a distinct tool is needed, then I think the documentation should list exact commands needed to:
.xhprof
file into the other tool.jsonl
file from the other tool.jsonl
file from the other tool and import it into xhguiIf I'm still totally confused about how to do this, it's probably because the new ignorant user (me) is not able to find any clear documentation on how to do these things...
it is not possible to import .xhprof
(I still don't know what does it even contain), as it lacks request information needed by xhgui.
I answered that here:
the only supported way to profile is this library:
that is probably why you can't find any documentation for custom use-cases.
you may try to use classes from perftools/php-profiler
to build jsonl files from xprof files, emulating missing metadata, and submit your files yourself. you need some coding expertise to do that. the newly added cli script to run import may be of a good help.
Attempting to import an
.xhprof
file into the mongodb fails on fresh install with the following errorIn fact, there is no
vendor
directory at all. What is it trying torequire()
?Problem
There is no
vendor/autoload.php
file present after doing the Docker install (and not even avendor
directory). This causes attempts to import.xhprof
files to fail.Moreover,
/external/import.php
is not available from the web server, and it's entirely unclear/undocumented as to how a user is supposed to import.xhprof
files intoxhgui
, as pointed out in this other ticket:Expected Solution
php external/import.php -f /path/to/some.xhprof
and it successfully imports the file intoxhgui
http://localhost:8142/external/import.php
in my browser after installing via Docker.xhprof
file into XHGui after a fresh Docker installSteps to Reproduce
This bug can be reproduced by executing the following commands on a Debian 11 system:
Then, copy
some.xhprof
file to/home/user/
and runContext
I'm running this on an AppVM in QubesOS running Debian 11.
I've checked-out this repo on branch
0.21.x