Example #1
0
 /**
  * Start the query benchmark
  *
  * @param Event $event
  * @param Adapter $database
  */
 public function beforeQuery(Event $event, Adapter $database)
 {
     $metadata = ['query' => $database->getSQLStatement()];
     $params = $database->getSQLVariables();
     if (isset($params)) {
         $metadata['params'] = $params;
     }
     $bindtypes = $database->getSQLBindTypes();
     if (isset($bindtypes)) {
         $metadata['bindTypes'] = $bindtypes;
     }
     $desc = $database->getDescriptor();
     if (isset($desc['dbname'])) {
         $metadata['database'] = $desc['dbname'];
     }
     $this->benchmark = $this->getProfiler()->start(get_class($event->getSource()) . '::query', $metadata, 'Database');
 }
 /**
  * Start the query benchmark
  *
  * @param Event $event
  * @param Adapter $database
  */
 public function beforeQuery(Event $event, Adapter $database)
 {
     $metadata = ['query' => $database->getSQLStatement()];
     $this->benchmark = $this->getProfiler()->start(get_class($event->getSource()) . '::query', $metadata, 'Database');
 }