[Rt-commit] rt branch, master, updated. rt-4.2.11-229-g3cfb7d8

Shawn Moore shawn at bestpractical.com
Mon Oct 5 15:15:07 EDT 2015


The branch, master has been updated
       via  3cfb7d8f48d1c019e7eb0d740255045b23195a45 (commit)
      from  4aecd6f8fc448450610877e89e110075e4baf5fe (commit)

Summary of changes:
 share/html/Admin/Tools/Queries.html | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 3cfb7d8f48d1c019e7eb0d740255045b23195a45
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Dec 13 16:12:57 2010 -0500

    Add Undup and ShowElem params to query log tool

diff --git a/share/html/Admin/Tools/Queries.html b/share/html/Admin/Tools/Queries.html
index 66427de..d7a8898 100644
--- a/share/html/Admin/Tools/Queries.html
+++ b/share/html/Admin/Tools/Queries.html
@@ -45,6 +45,10 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
+<%args>
+$Undup => 1
+$ShowElem => 0
+</%args>
 <%init>
 my $title = loc('SQL Queries');
 unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
@@ -93,7 +97,7 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super
 %                 my @undup;
 %                 for my $statement (@{ $request->{Queries} }) {
 %                      my ($dup) = grep {$_->[1] eq $statement->[1]} @undup[-(@undup > 3?3:@undup)..-1];
-%                      if ($dup) {
+%                      if ($Undup and $dup) {
 %                          $dup->[2] = [$dup->[2]] unless $dup->[5];
 %                          push @{$dup->[2]}, $statement->[2];
 %                          $dup->[3] += $statement->[3];
@@ -102,8 +106,16 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super
 %                          push @undup, $statement;
 %                      }
 %                 }
+%                 my $element = '';
 %                 for my $statement (@undup) {
 %                      my ( $time, $sql, $bind, $duration, $trace, $dup ) = @$statement;
+%                      if ($ShowElem) {
+%                          my($cur_element) = $trace =~ m{called at (.*?) line \d+\n\s+HTML::Mason::Commands::__ANON__};
+%                          if ($element ne $cur_element) {
+                               <tr><td colspan="3"><b><tt><% $cur_element %></tt></b></td></tr>
+%                              $element = $cur_element;
+%                          }
+%                      }
 %                      $sql = $RT::Handle->FillIn($sql, $bind) unless $dup;
                        <tr>
                            <td><% ++$s %><% $dup ? " (x $dup)" : "" %></td>

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


More information about the rt-commit mailing list