Db_Profiler_Firebug documentation

8 messages Options
Embed this post
Permalink
mikaelkael

Db_Profiler_Firebug documentation

Reply Threaded More More options
Print post
Permalink
Hi,

In the documentation, we just have:
 // Instantiate the profiler in your bootstrap file
 $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');

 // Attach the profiler to your db adapter
 $db->setProfiler($profiler)

 // All DB queries will now be profiled and sent to Firebug

I need also to register the plugin:
 $front->registerPlugin(Zend_Wildfire_Channel_HttpHeaders::getInstance());

Is what I do in the good way?

Mickael.
gerardroche

Re: Db_Profiler_Firebug documentation

Reply Threaded More More options
Print post
Permalink

$profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
$profiler->setEnabled(true);
$db->setProfiler($profiler)

Should work.

I think the docs are missing the second line.

mikaelkael wrote:
Hi,

In the documentation, we just have:
 // Instantiate the profiler in your bootstrap file
 $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');

 // Attach the profiler to your db adapter
 $db->setProfiler($profiler)

 // All DB queries will now be profiled and sent to Firebug

I need also to register the plugin:
 $front->registerPlugin(Zend_Wildfire_Channel_HttpHeaders::getInstance());

Is what I do in the good way?

Mickael.
Christoph Dorn

Re: Db_Profiler_Firebug documentation

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
I thought that enabling the profiler is a given that is why I left it out, but reading it again now, it would probably make sense to add it.

I'll commit a patch for the docs tonight.

Christoph



gerardroche wrote:
$profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
$profiler->setEnabled(true);
$db->setProfiler($profiler)

Should work.

I think the docs are missing the second line.


mikaelkael wrote:
  
Hi,

In the documentation, we just have:
 // Instantiate the profiler in your bootstrap file
 $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');

 // Attach the profiler to your db adapter
 $db->setProfiler($profiler)

 // All DB queries will now be profiled and sent to Firebug

I need also to register the plugin:
 $front->registerPlugin(Zend_Wildfire_Channel_HttpHeaders::getInstance());

Is what I do in the good way?

Mickael.

    

  



MG

Re: Db_Profiler_Firebug documentation

Reply Threaded More More options
Print post
Permalink
I use profiler together with logging other "TABLE", however only one table is displayed...table from profiler if present (if queries were executed) seems to overwrite my TABLE from Zend_Log_Writer_Firebug.
I use something like this:

            $request = new Zend_Controller_Request_Http();
            $response = new Zend_Controller_Response_Http();
            $this->_logChannel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
            $this->_logChannel->setRequest($request);
            $this->_logChannel->setResponse($response);
           
            $this->_logWriter = new Zend_Log_Writer_Firebug();
            $this->_logWriter->setPriorityStyle(8, 'TABLE');      
                       
            $this->_logger = new Zend_Log($this->_logWriter);
            $this->_logger->addPriority('TABLE', 8);

...

                $profiler = new Zend_Db_Profiler_Firebug('Queries');
                $profiler->setEnabled(true);
                $this->_db->setProfiler($profiler);

...

$table = ...
        $this->getLogger()->table($table);
       
        $this->_logChannel->flush();
        $this->_logChannel->getResponse()->sendHeaders();

I get this in headers:
X-Wf-1-1-1-1 |[{"Type":"TABLE"},["Queries (0.00114 sec)",[["Time","Event","Parameters"],[0.00096,"connect",null],[0.00018,"SELECT * FROM core_langs",null]]]]|
X-Wf-1-Index 2
X-Wf-1-1-1-2 |[{"Type":"TABLE"},["Timetable",[["Mark","Time"],["Total","0.2274529934"],["Load Objects","0.1348688602"],["Load FrontContoller","0.0068719387"],["Load Plugins & PreDispatch","0.0306580067"],["Dispatch","0.0548908710"]]]]|


Am I doing sth wrong?

Thanks Chris.
Christoph Dorn

Re: Db_Profiler_Firebug documentation

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
The code looks fine. This may be a bug. I'll be able to check into it tonight and let you know.

Christoph


Marcin Gil wrote:
I use profiler together with logging other "TABLE", however only one table is
displayed...table from profiler if present (if queries were executed) seems
to overwrite my TABLE from Zend_Log_Writer_Firebug.
I use something like this:

            $request = new Zend_Controller_Request_Http();
            $response = new Zend_Controller_Response_Http();
            $this->_logChannel =
Zend_Wildfire_Channel_HttpHeaders::getInstance();
            $this->_logChannel->setRequest($request);
            $this->_logChannel->setResponse($response);
            
            $this->_logWriter = new Zend_Log_Writer_Firebug();
            $this->_logWriter->setPriorityStyle(8, 'TABLE');       
                        
            $this->_logger = new Zend_Log($this->_logWriter);
            $this->_logger->addPriority('TABLE', 8);

...

                $profiler = new Zend_Db_Profiler_Firebug('Queries');
                $profiler->setEnabled(true);
                $this->_db->setProfiler($profiler);

...

$table = ...
        $this->getLogger()->table($table);
        
        $this->_logChannel->flush();
        $this->_logChannel->getResponse()->sendHeaders();

Am I doing sth wrong? 

Thanks Chris.
  



MG

Re: Db_Profiler_Firebug documentation

Reply Threaded More More options
Print post
Permalink
Thanks Chris.
I wait for You reply.

Please tell me if I can be of any assistance.
Christoph Dorn

Re: Db_Profiler_Firebug documentation

Reply Threaded More More options
Print post
Permalink
In reply to this post by MG
Some javascript/style in this post has been disabled (why?)
Sorry about the delay.

I have tested it out and it seems to work fine for me. Would you be able to put together an exact test case you can send me so I can help troubleshoot it for you.

Christoph



Marcin Gil wrote:
I use profiler together with logging other "TABLE", however only one table is
displayed...table from profiler if present (if queries were executed) seems
to overwrite my TABLE from Zend_Log_Writer_Firebug.
I use something like this:

            $request = new Zend_Controller_Request_Http();
            $response = new Zend_Controller_Response_Http();
            $this->_logChannel =
Zend_Wildfire_Channel_HttpHeaders::getInstance();
            $this->_logChannel->setRequest($request);
            $this->_logChannel->setResponse($response);
            
            $this->_logWriter = new Zend_Log_Writer_Firebug();
            $this->_logWriter->setPriorityStyle(8, 'TABLE');       
                        
            $this->_logger = new Zend_Log($this->_logWriter);
            $this->_logger->addPriority('TABLE', 8);

...

                $profiler = new Zend_Db_Profiler_Firebug('Queries');
                $profiler->setEnabled(true);
                $this->_db->setProfiler($profiler);

...

$table = ...
        $this->getLogger()->table($table);
        
        $this->_logChannel->flush();
        $this->_logChannel->getResponse()->sendHeaders();

Am I doing sth wrong? 

Thanks Chris.
  



MG

Re: Db_Profiler_Firebug documentation

Reply Threaded More More options
Print post
Permalink
You are right Chris. All works fine. The problem was in my code:

I was sending Wildfire headers:

$this->_logChannel->flush();
$this->_logChannel->getResponse()->sendHeaders();

after

$response->sendResponse();  


This was the problem.
Now it's all working fine.
Sorry for trouble.