Noting like writing an email to trigger reading the docs again.

On Tue, Oct 7, 2014 at 11:43 AM, Bill Moseley <mose...@hank.org> wrote:

> I'm trying to just count number of database queries and the time spent
> waiting on the database.
>

Does this look correct?

my $h = DBI::Profile->new( Path => [ sub { return $_[1] =~
/^(?:execute|do|select)/ ? undef : \undef;} ] );




>
> I can use this to just gather grand totals:
>
> DBI::Profile->new( Path => [ ] );
>
> The total time is fine even if it includes the small amount of time in DBI
> instead of directly waiting on the database. But, the counts are do not
> represent just trips to the database, rather apparently counts of all
> methods called (e.g. a prepare and execute counts as 2).
>
> Using:
>
> DBI::Profile->new( Path => [ '!MethodName' ] );
>
> might be ok, but I'd have to then find all the methods that go to the db
> (e.g. "execute", "do").
>
> Can I use DBI::Profile to just gather up counts to the database?
>
> Thanks,
>
>
> --
> Bill Moseley
> mose...@hank.org
>



-- 
Bill Moseley
mose...@hank.org

Reply via email to