joshstrange 2 days ago

Yeah, from a brief glance at this, it just adds a file that runs on every request which logs out to the php error log and then there’s another script that can parse that error log.

1
zerodeux 1 day ago

Exactly.

I'm the author, it's funny this thing pops up now, it was written +15 years ago and is barely maintained (but AFAKI still works).

The metrics collected are close to those from PHP-FPM (CPU user/sys, clock time, peak memory) + the wpdb hook because I had to profile lots of WP.

The most interesting part is the 'phptop' tool itself which actually parse the logs and make some useful histograms.

Its main force I think it's that it's very lightweight (500 lines of Perl, fast and efficient regexes), works everywhere (very old Perl will do), and gives results instantly. My usecase used to be : apt install phptop, wait (at least) 1min for data collection, get useful histogram. It's also obviously very easy to uninstall.

It does pollute the error log, but it's the most simple and universal data sink I could think of, and well it's a hack in the end.

Patches still welcome anyway :).