A: 

Hi,

The profiler 'bundles' connection and other operations in with the general queries.

There's three ways you might examine the connection specifically:

  1. Set a filter on the profiler during setup:

    $profiler->setFilterQueryType(**Zend_Db_Profiler::CONNECT**);
    

    Then the resultant profiles will only include 'connect' operations.

  2. Specify a query type when you retrieve the Query Profiles:

    $profiles = $profiler->getQueryProfiles(**Zend_Db_Profiler::CONNECT**);
    
  3. Examine the query objects directly during the iteration:

    foreach($profiler->getQueryProfiles() as $query) {
    if ($query->getQueryType() == Zend_Db_Profiler::CONNECT &&
       $query->getElapsedSecs() > $longestConnectionTime) {
           $longestConnectionTime  = $query->getElapsedSecs();
       } 
    }
    

You'll not find great detail in there, it's logged just as a 'connect' operation along with the time taken.

Simon Christian
That's my problem though - this isn't working for me! There are no connection records logged, so there is nothing to filter. I'll try and update my question to give more information on this.
asgeo1
It does seem that the Oracle adapter is not making the relevant calls to the profiler for connection. Comparing the _connect() methods in Zend_Db_Adapter_Pdo_Abstract and Zend_Db_Adapter_Oracle, before creating the connection the former calls: $q = $this->_profiler->queryStart('connect', Zend_Db_Profiler::CONNECT); and afterwards: $this->_profiler->queryEnd($q);The Oracle adapter has no reference to the profiler (up to version 1.10.2 at least), but I imagine it might be as simple as adding equivalent calls in the _connect() method.
Simon Christian