This assunmes you're running wp in lando with php >= 8
services:
appserver:
build_as_root:
- pecl install xhprof && echo "extension=xhprof.so" > $PHP_INI_DIR/conf.d/xhprof.ini
extension=xhprof.so
xhprof.sampling_interval=1000
Then run lando rebuild -y
ini_set('xhprof.sampling_interval', 1000);
xhprof_sample_enable();
https://wordpress.org/plugins/query-monitor/
https://github.com/humanmade/query-monitor-flamegraph
(I don't think this is on the store, I had to download zip & paste it in ./web/wp-contents/plugins
)