Ticket #242: profiler.patch

File profiler.patch, 0.7 kB (added by charlie, 6 months ago)

An extremely minor, but handy patch for totaling up rows for database queries in addition to query execution time.

  • Profiler.php

     
    175175 
    176176                text::alternate(); 
    177177                $total_time = 0; 
     178                $total_rows = 0; 
    178179                foreach ($queries as $query) 
    179180                { 
    180181                        $data = array($query['query'], number_format($query['time'], 3), $query['rows']); 
    181182                        $class = text::alternate('', 'kp-altrow'); 
    182183                        $table->add_row($data, $class); 
    183184                        $total_time += $query['time']; 
     185                        $total_rows += $query['rows']; 
    184186                } 
    185187 
    186                 $data = array('Total: ' . count($queries), number_format($total_time, 3), ''); 
     188                $data = array('Total: ' . count($queries), number_format($total_time, 3), $total_rows); 
    187189                $table->add_row($data, 'kp-totalrow'); 
    188190        } 
    189191