Found 2 bookmarks
Custom sorting
Pinba
Pinba
Pinba is a statistics server for PHP using MySQL as a read-only interface.\nIt accumulates and processes data sent over UDP by multiple PHP processes and displays statistics in a nice human-readable form of simple "reports", also providing read-only interface to the raw data in order to make possible generation of more sophisticated reports.\nWith Pinba extension users also can measure particular parts of the code using timers with arbitrary tags.\nPinba is not a debugging tool in a common sense, since you're not supposed to do debugging on production servers, but its main goal is to help developers to locate bottlenecks in realtime and direct developers' attention to the code that really needs it.
Pinba
MySQLnd Plugins: Writing a MySQL Query Logger in PHP - ThinkPHP /dev/blog
MySQLnd Plugins: Writing a MySQL Query Logger in PHP - ThinkPHP /dev/blog
A new approach to implementing a query logger and potentially more complex features such as monitoring or read/write-splitting is the MySQLnd Userland Handler Extension (mysqlnd_uh, pecl website). The extension lets you register a PHP class as a proxy for every MySQLndconnection. Every call to a function to MySQLnd (usually indirect through mysqli, mysql, pdo_mysql) is passed to the PHP class, which then calls the original MySQLnd function. The extension makes it possible to use a custom userland class as a transparent proxy for all MySQLnd frontend (again mysqli, mysql, pdo_myslq). In the next section, I'll outline the requirements of mysqlnd_uh and show a sample implementation.
MySQLnd Plugins: Writing a MySQL Query Logger in PHP - ThinkPHP /dev/blog