Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Measuring wait time for openning a new connection

Re: Measuring wait time for openning a new connection

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Sun, 13 Aug 2006 18:16:03 GMT
Message-Id: <pan.2006.08.13.18.16.00.675659@sbcglobal.net>


On Sun, 13 Aug 2006 02:43:10 -0700, eyal.yurman wrote:

> Hi,
>
> I have an application (perl, using DBI) which opens many connections to
> the database.
>
> Will I see the effect of the connections on the wait events?
> If not, can I measure this effect using the listener?
>
>
> Thanks,
> Eyal Yurman.

Eyal, in my opinion, the best way to measure code execution times in Perl programs is Devel::Timer. It's very simple and straightforward. Here is what perldoc -m Devel::Timer says:

=head1 DESCRIPTION

Devel::Timer allows developers to accurately time how long a specific piece of code takes to execute. This can be helpful in locating the slowest parts of an existing application.

First, the Devel::Timer module is used and instantiated.

  use Devel::Timer;

  my $t = new Devel::Timer();

Second, markers are placed before and after pieces of code that need to be timed. For this example, we are profiling the methods get_user_score() and get_average_user_score().

  $t->mark("first db query");
  &get_user_score($user);

  $t->mark("second db query");
  &get_average_user_score();

Finally, at the end of the code that you want to profile, and end marker is place, and a report is generated on stderr.

  $t->mark("END");
  $t->report();

Sample report:

  Devel::Timer Report -- Total time: 0.3464 secs   Interval Time Percent


  02 -> 03  0.3001  86.63%  second db query -> END
  01 -> 02  0.0461  13.30%  first db query -> second db query
  00 -> 01  0.0002   0.07%  INIT -> first db query





-- 
http://www.mgogala.com
Received on Sun Aug 13 2006 - 13:16:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US