[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.6-361-g7caefcb

Alex Vandiver alexmv at bestpractical.com
Mon Dec 6 14:40:29 EST 2010


The branch, 3.9-trunk has been updated
       via  7caefcbb211b43b281f766476187dc8b8027c4aa (commit)
       via  868f585e4b36aa4f5dedc12d9a3b147477e35f7b (commit)
      from  9d8d1546f51307b1f26f334ce4d42eb93b0c3961 (commit)

Summary of changes:
 share/html/Admin/Tools/Queries.html |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 868f585e4b36aa4f5dedc12d9a3b147477e35f7b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Dec 3 17:44:56 2010 -0500

    Don't localize <i> tags

diff --git a/share/html/Admin/Tools/Queries.html b/share/html/Admin/Tools/Queries.html
index 0fc60ff..627c207 100644
--- a/share/html/Admin/Tools/Queries.html
+++ b/share/html/Admin/Tools/Queries.html
@@ -95,7 +95,7 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super
 
                        <tr>
                            <td><% ++$s %></td>
-                           <td><&|/l, sprintf('%.4f', $duration) &><i>[_1]s</i></&></td>
+                           <td><i><&|/l, sprintf('%.4f', $duration) &>[_1]s</&></i></td>
                            <td>
                                <tt><% $sql %></tt>
                                <a class="query-stacktrace-toggle" href="#" onclick="return hideshow('trace-<%$r%>-<%$s%>');"><&|/l &>Toggle stack trace</&></a>

commit 7caefcbb211b43b281f766476187dc8b8027c4aa
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Dec 3 18:12:50 2010 -0500

    Merge duplicate statements in the SQL log, with some (3 lines) locality fuzz

diff --git a/share/html/Admin/Tools/Queries.html b/share/html/Admin/Tools/Queries.html
index 627c207..4d16fd3 100644
--- a/share/html/Admin/Tools/Queries.html
+++ b/share/html/Admin/Tools/Queries.html
@@ -89,15 +89,31 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super
                   </thead>
                   <tbody>
 %                 my $s = 0;
+%                 my @undup;
 %                 for my $statement (@{ $request->{Queries} }) {
-%                      my ( $time, $sql, $bind, $duration, $trace ) = @$statement;
-%                      $sql = $RT::Handle->FillIn($sql, $bind);
-
+%                      my ($dup) = grep {$_->[1] eq $statement->[1]} @undup[-(@undup > 3?3:@undup)..-1];
+%                      if ($dup) {
+%                          $dup->[2] = [$dup->[2]] unless $dup->[5];
+%                          push @{$dup->[2]}, $statement->[2];
+%                          $dup->[3] += $statement->[3];
+%                          $dup->[5] ||= 1; $dup->[5]++;
+%                      } else {
+%                          push @undup, $statement;
+%                      }
+%                 }
+%                 for my $statement (@undup) {
+%                      my ( $time, $sql, $bind, $duration, $trace, $dup ) = @$statement;
+%                      $sql = $RT::Handle->FillIn($sql, $bind) unless $dup;
                        <tr>
-                           <td><% ++$s %></td>
+                           <td><% ++$s %><% $dup ? " (x $dup)" : "" %></td>
                            <td><i><&|/l, sprintf('%.4f', $duration) &>[_1]s</&></i></td>
                            <td>
                                <tt><% $sql %></tt>
+%                              if ($dup and @{$bind->[0]}) {
+%                                  for my $b (@{$bind}) {
+                                       <br><tt>[<% join(", ", @$b) %>]</tt>
+%                                  }
+%                              }
                                <a class="query-stacktrace-toggle" href="#" onclick="return hideshow('trace-<%$r%>-<%$s%>');"><&|/l &>Toggle stack trace</&></a>
                                <pre id="trace-<%$r%>-<%$s%>" class="hidden"><% $trace %></pre>
                            </td>

-----------------------------------------------------------------------


More information about the Rt-commit mailing list