[xdebug-general] [Slightly OT] Production Application Metrics

From: Morgan Tocker <tocker[@]gmail.com>
Date: Tue, 28 Jul 2009 13:28:04 -0400

Hi list,

Apologies for a slightly O/T post.  I'm in the process of
investigating how to _best_ extract diagnostic information from
production applications.  The only information I am interested in is:

- Time spent on RPCs (database, fetching from remote web APIs, etc.)
- Wall Time
- CPU time

I thought of XDebug - but I was worried it might be too much overhead
for production, since I will be running it for 1-10% of all requests*.
 If you have any data on this, I'd be interested to hear it ;)  In a
perfect world, what I would like to do is to be able to register hooks
on functions so that I can just start and stop timers:


function my_callback_function($function_name, [args]) {
 // Can start and stop timers here.

function my_callback_function_exit($function_name, [args]) {
 // Can start and stop timers here.

register_callback_function_start('mysql_query', 'my_callback_function');
register_callback_function_exit('mysql_query', 'my_callback_function_exit');

register_callback_function_start('file', 'my_callback_function');
register_callback_function_exit('file', 'my_callback_function_exit');


Reading the Xdebug source, this should be fairly easy to do?

* To pretext questions - I need online analysis - PHP code without
affinity can scale well by adding webservers, but databases and
external requests are going to behave differently as load traffic changes.

- Morgan
Received on Tue Jul 28 2009 - 19:28:07 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST