Logging the Execution times of dynamically constructed mysql stored procedures I have a MySQL Server.

The MySQL server contains a huge network data collection. 
The client API's will connect to the MySQL server and execute some dynamically created stored procedures and delete it on the fly after successful execution. 
There is no tracking mechanism currently available.
I wont be able to modify the stored procedures, as it is dynamically created by the client API's

Is there any mechanism to track the execution of such dynamically created stored procedures ?
You could capture the mysqld's uptime or the DB Server's time at the start and end of your code.

Perhaps something like this

SUGGESTION #1

SELECT variable_value INTO @t1
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE variable_name='uptime';
&lt;Your Stored Procedure Code&gt;
SELECT variable_value INTO @t2
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE variable_name='uptime';
SET @RunningTimeSec = @t2 - @t1;
SET @RunningTime = SEC_TO_TIME(@RunningTimeSec);
INSERT INTO sometable ... VALUES (...,@RunningTimeSec,...);


SUGGESTION #2

SET @t1 = UNIX_TIMESTAMP(NOW());
&lt;Your Stored Procedure Code&gt;
SET @t2 = UNIX_TIMESTAMP(NOW());
SET @RunningTimeSec = @t2 - @t1;
SET @RunningTime = SEC_TO_TIME(@RunningTimeSec);
INSERT INTO sometable ... VALUES (...,@RunningTimeSec,...);


GIVE IT A TRY !!!