[eluser]Kenshiro[/eluser]
hello i have built a custom mini/profiler for my current project (i used 3 different methods as a standalone library, as profiler extension and as a benchmark extension)
I have a little problem though... if it's standalone/benchmark... the number of queries returned is always off.. it never goes over 7...
The drawback of using it as a profiler extension though is that i lose the normal profiler for dev purpose (as it replace the profiler) but then the number of queries seems to be accurate...
here is the method invoked :
Code:
function _compile_queries() {
$nbqueries = count($this->CI->db->queries);
$output = '<li class="sql">'.$nbqueries.' queries</li>';
return $output;
}
** Update ** i tried a couple of methods... and it only returns the number of queries run in the constructor of my controller and not during a method is parsed... as i am using templates i have to append manually the footer to each submethods of my controller... which is counter efficient
...
I use a main template, the methods in my controller only call the model to retrieve/parse the data and the method output the global template, this way i partially build the template from the controller (all pages besides the content have the same layout). It avoids duplication of calls to $this->parser to generate header/body/footer...
But because i do so, the number of queries are off as only what's in the controller get accounted.