On Mon, May 27, 2002 at 09:59:17PM -0700, Jason wrote:
> Would it be possible to extract the profiling engine from DBI and make 
> it available to the calling application?

There will be something along these lines

    $time1 = dbi_hires_time();
    ...
    $time2 = dbi_hires_time();
    dbi_profile($h, $foo, $bar, $time1, $time2);

where $foo is generally the statement text (and if undef then
$h->{Statement} will be used) and $bar is the method name.

They'll also be the ability (for that) to trigger a code hook to
tell it where in the profile data hash tree to merge the new data into.

> Or to make it play nicely with 
> other run-time profiling modules (if there are any decent ones)?  For 
> example, it would be nice to be able to have a mod_perl application be 
> able to collect performance information in a common format from database 
> queries, HTML template generation, and application code.

I'll make it as general as I can without compromising the DBI.
This is first and foremost a DBI tool.

> Some options for controlling the output would also be nice.  I'd like to 
> be able to accumulate performance data over a series of queries and then 
> output a formatted report all at once.  Maybe this sort of thing belongs 
> in add-on modules as you suggested.

Exactly. Subclasses of DBI::Profile.

Tim.

Reply via email to