Merge Brian's change in r539.

This commit is contained in:
Daniel Nichter
2013-03-05 10:01:08 -07:00
4 changed files with 28 additions and 130 deletions

View File

@@ -7541,8 +7541,8 @@ use constant PTDEBUG => $ENV{PTDEBUG} || 0;
my $have_json = eval { require JSON };
our $pretty_json = undef;
our $sorted_json = undef;
our $pretty_json = 0;
our $sorted_json = 0;
extends qw(QueryReportFormatter);
@@ -7588,6 +7588,8 @@ override query_report => sub {
my $worst = $args{worst};
my @attribs = @{$ea->get_attributes()};
my %string_args = map { $_ => 1 } qw( db host arg user bytes pos_in_log );
my @queries;
foreach my $worst_info ( @$worst ) {
@@ -7628,6 +7630,9 @@ override query_report => sub {
$class{ts_min} = $ts->{min};
$class{ts_max} = $ts->{max};
}
elsif ( $string_args{$attrib} ) {
$metrics{$attrib} = { value => $metrics{$attrib}{max} };
}
elsif ( ($ea->{type_for}->{$attrib} || '') eq 'num' ) {
for my $value ( values %{$metrics{$attrib}} ) {
next unless $value;