Skip to content

Commit

Permalink
Display the query count correctly for Delegate profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
brendo committed Feb 3, 2013
1 parent a90d40f commit 74f9673
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions content/content.profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,27 +210,18 @@ public function buildContent(XMLElement $wrapper) {
$table->appendChild($row);

foreach($extensions as $extension) {
//var_dump($extension);
$execution_time = number_format($extension[1], 4);
$extension_row = new XMLElement('tr');

// Poor man's grouping.
$extension_row->appendChild(new XMLElement('td', ' '));
$extension_row->appendChild(new XMLElement('th', $extension[0]));
$extension_row->appendChild(new XMLElement('td', $execution_time . ' s from ' . count($extension[4]) . ' ' . ($extension[4] == 1 ? 'query' : 'queries')));
$extension_row->appendChild(new XMLElement('td', $execution_time . ' s from ' . $extension[4] . ' ' . ($extension[4] == 1 ? 'query' : 'queries')));

$table->appendChild($extension_row);
$tt += $execution_time;
$tq += (is_array($extension[4])) ? count($extension[4]) : $extension[4];
if(!in_array($extension[0], $te)) $te[] = $extension[0];

if(is_array($extension[4])) {
foreach($extension[4] as $query) {
$query_row = new XMLElement('tr');
$query_row->appendChild(new XMLElement('th', $query['execution_time']));
$query_row->appendChild(new XMLElement('td', $query['query']));
$table->appendChild($query_row);
}
}
}

$row->appendChild(new XMLElement('td', number_format($tt, 4) . ' s from ' . count($te) . ' extensions and ' . $tq . ' ' . ($tq == 1 ? 'query' : 'queries')));
Expand Down

0 comments on commit 74f9673

Please sign in to comment.