Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Custom benchmark/miniprofiler
#1

[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 Confused...

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.


Messages In This Thread
[SOLVED] Custom benchmark/miniprofiler - by El Forum - 04-29-2010, 06:23 AM
[SOLVED] Custom benchmark/miniprofiler - by El Forum - 04-29-2010, 08:08 AM
[SOLVED] Custom benchmark/miniprofiler - by El Forum - 04-29-2010, 08:17 AM
[SOLVED] Custom benchmark/miniprofiler - by El Forum - 04-29-2010, 08:35 AM
[SOLVED] Custom benchmark/miniprofiler - by El Forum - 04-29-2010, 08:46 AM
[SOLVED] Custom benchmark/miniprofiler - by El Forum - 04-29-2010, 09:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB