summaryrefslogtreecommitdiffstats
path: root/system/libraries/Profiler.php
diff options
context:
space:
mode:
authorTim <vampik@gmail.com>2013-02-13 09:34:16 +0100
committerTim <vampik@gmail.com>2013-02-13 09:34:16 +0100
commit0b607252b1f3bcabfb8150120e683795ec3a0890 (patch)
tree624fa89ac5019ede6c557cb78d1465b01021ba2c /system/libraries/Profiler.php
parentc2268711a27809575f82b21e64fde6cd953ef7f9 (diff)
Added small feature to profiler: total execution time count
adds additional information to profiler like: DATABASE:  test   QUERIES: 3 (0.0016s)  (Hide)
Diffstat (limited to 'system/libraries/Profiler.php')
-rw-r--r--system/libraries/Profiler.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index e93239901..67922d51c 100644
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -238,6 +238,8 @@ class CI_Profiler {
foreach ($dbs as $name => $db)
{
$hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : '';
+
+ $total_time = number_format(array_sum($db->query_times), 4) . 's';
$show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_hide').'\'?\''.$this->CI->lang->line('profiler_section_show').'\':\''.$this->CI->lang->line('profiler_section_hide').'\';">'.$this->CI->lang->line('profiler_section_hide').'</span>)';
@@ -250,7 +252,7 @@ class CI_Profiler {
."\n"
.'<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database')
.':&nbsp; '.$db->database.' ('.$name.')&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries')
- .': '.count($db->queries).'&nbsp;&nbsp;'.$show_hide_js."</legend>\n\n\n"
+ .': '.count($db->queries).'('.$total_time.')'.'&nbsp;&nbsp;'.$show_hide_js."</legend>\n\n\n"
.'<table style="width:100%;'.$hide_queries.'" id="ci_profiler_queries_db_'.$count."\">\n";
if (count($db->queries) === 0)
@@ -553,4 +555,4 @@ class CI_Profiler {
}
/* End of file Profiler.php */
-/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file
+/* Location: ./system/libraries/Profiler.php */