nchmy 1 day ago

Its not evident to me what this does... It says that it "prints per query and average metrics", but it seems to just output some extremely generic stats. Does "query" actually mean request here?

I see there's a wordpress-specific wpdb mechanism - though it just seems to report total time spent on queries, and the slowest query. Surely something like Query Monitor is a far better tool for that?

A tool that everyone should be aware of and using is php-spx - its absolutely glorious for performance profiling/investigation. xhgui is similar, but bulkier and (in my experience) less accurate/insightful.

https://github.com/NoiseByNorthwest/php-spx

3
xd 1 day ago

From a quick skim of the repo it looks to be injecting phptop_hook.php into any call to a php file with auto_prepend_file in php.ini. phptop_hook.php generates some stats on how long it took the php file to process and stores this via error_log() which can then be queried with the perl script phptop.

zerodeux 1 day ago

Author here.

"Query" does mean "HTTP request" in the summary. It's reported as "Hits" in the stats. Sorry for the incoherent wording ...

The SQL/wpdb support was added afterwards, and it shows because data is only collected but not used/displayed in the histograms.

Phptop is wayyy simpler and not even comparable to SPX, but you can install it in a few sec, use it 5min, uninstall it, and solve lots of common perf problem. That was my use case (it'as ancient code and I barely use it nowadays).

nchmy 1 day ago

Thanks for the clarification!

What do you use now?

BafS 1 day ago

I can't praise SPX enough, it has saved my ass multiple times. The UI is great too.