summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Kollmorgen2003-06-21 16:03:02 (GMT)
committerAxel Kollmorgen2003-06-21 16:03:02 (GMT)
commit165ccf56964b310d7f203f45a67bdbb0f64e61a1 (patch)
treec1267d7656905b467ec7f2c9c5a6338ecea69135
parentca717cceb9645b1fee3c04fb4f302d173ad9d5c4 (diff)
- show total query count + time4.2.x-1.x
- show + explain "Query execution threshhold" - 'style="color: red; " class="error"' => 'class="marker"' - wrapped query display in drupal_specialchars() to avoid strange rendering of queries containing html - wrapped complete output in box() to get a nice title and separate it better from normal content
-rw-r--r--devel.module15
1 files changed, 10 insertions, 5 deletions
diff --git a/devel.module b/devel.module
index 3974513..1315f3b 100644
--- a/devel.module
+++ b/devel.module
@@ -15,6 +15,7 @@ function devel_query_table() {
$header = array ("ms", "#", "query");
foreach ($queries as $query) {
$text[] = $query[0];
+ $sum += $query[1];
}
$counts = array_count_values($text);
@@ -23,21 +24,25 @@ function devel_query_table() {
$diff = round($query[1]*1000,2);
$count = $counts[$query[0]];
if ($diff > 5) {
- $cell[$i][] = array ("data" => $diff, "style" => "color: red; \" class=\"error\"");
+ $cell[$i][] = array ("data" => $diff, "class" => "marker");
}
else {
$cell[$i][] = $diff;
}
if ($count > 1) {
- $cell[$i][] = array ("data" => $count, "style" => "color: red;", "class" => "error");
+ $cell[$i][] = array ("data" => $count, "class" => "marker");
}
else {
$cell[$i][] = $count;
}
- $cell[$i][] = $query[0];
+ $cell[$i][] = drupal_specialchars($query[0]);
$i++;
- }
- return table($header, $cell);
+ }
+ $output =
+ t('Executed %count queries in %msec microseconds. ', array ("%count" => count($queries), "%msec" => round($sum * 1000, 2))) .
+ t('Queries taking longer than %devel_execution milliseconds are <span class="marker">highlighted</span>.', array ("%devel_execution" => variable_get("devel_execution", 5))) ."\n".
+ table($header, $cell);
+ return theme("box", t("Query log"), $output);
}
// handy pretty print of arrays and objects. like var_dump()